Posted By

on 06/18/09


Tagged

javascript html DOM


Versions (?)

Deshabilitar / Habilitar objetos con DOM


 / Published in: PHP
 

URL: http://www.w3schools.com/htmldom/prop_select_disabled.asp

siempre se me olvida asi que mejor tenerlo de referencia aca :D

  1. <html>
  2. <head>
  3. <script type="text/javascript">
  4. function disable()
  5. {
  6. document.getElementById("mySelect").disabled=true
  7. }
  8. function enable()
  9. {
  10. document.getElementById("mySelect").disabled=false
  11. }
  12. </script>
  13. </head>
  14. <body>
  15.  
  16. <form>
  17. <select id="mySelect">
  18. <option>Apple</option>
  19. <option>Pear</option>
  20. <option>Banana</option>
  21. <option>Orange</option>
  22. </select>
  23. <br /><br />
  24. <input type="button" onclick="disable()" value="Disable list">
  25. <input type="button" onclick="enable()" value="Enable list">
  26. </form>
  27.  
  28. </body>

Report this snippet  

You need to login to post a comment.