I have input checkboxes printed like the following.
<input type="checkbox" id="a1" value="11" disabled="false">
<input type="checkbox" id="a2" value="21" disabled="true">
<input type="checkbox" id="a3" value="31" disabled="false">
I know the disabled attribute takes no value. So when the attribute is present the element becomes disabled irrespective of the value assigned to it. I want to remove all the disabled attribute from all input elements whose value is false.
Using jQuery I would like to use code like the following.
$("*[disabled]").not(true).removeAttr("disabled");
Why don’t you just match elements where
disabledisfalse?Demo: http://jsfiddle.net/ASN29/
The presence of the
disabledattribute automatically makes the element disabled, regardless of the attribute’s value, so this isn’t a very good idea. How does the HTML become this way?