So I have a button like this:
<input id="Button" type="button" value="+" style="background-color:grey" onclick="Me();"/>
How can I disable and enable it when I want? I have tried disabled="disable" but enabling it back is a problem. I tried setting it back to false but that didn’t enable it.
Using Javascript
Disabling a html button
Enabling a html button
Demo Here
Using jQuery
All versions of jQuery prior to 1.6
Disabling a html button
Enabling a html button
Demo Here
All versions of jQuery after 1.6
Disabling a html button
Enabling a html button
Demo Here
P.S. Updated the code based on jquery 1.6.1 changes. As a suggestion, always use the latest jquery files and the
prop()method.