Jump to content

Enable Disabled Input?


Twango

Recommended Posts

Get the disabled element somehow (e.g. getElementById(), querySelectorAll(), etc.), and set its disabled property to false.Being any more explicit will require some links or code on your part.

Link to comment
Share on other sites

hmm, this isnt working. why?

<html><body><script type="text/javascript">document.getElementById('a').disabled="false";</script></body></html><input type="checkbox" id="a" disabled="disabled"/>

Link to comment
Share on other sites

hmm, this isnt working. why?
<html><body><script type="text/javascript">document.getElementById('a').disabled="false";</script></body></html><input type="checkbox" id="a" disabled="disabled"/>

disabled is boolean, not a string property. And the string "false" evaluates to a boolean true.BTW, your input is out of your <html/> element, and only appears after your script, so those things may be a problem too.So, a working (though still invalid) code is:
<html><body><input type="checkbox" id="a" disabled="disabled"/><script type="text/javascript">document.getElementById('a').disabled=false;</script></body></html>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...