I am trying to disable a button – using jQuery 1.4.4 the following code in IE
jQuery('#id').attr("disabled", true);
With the HTML of
<button id="id" type="button"
class="some-class"
disabled="">Comment</button>
Works in FF, Chrome etc and of course, doesn’t work in IE ? How can I fix ?
i.e. the <button disabled="disabled"> doesn’t seem to work in IE or ?
Edit: Note also that <button id='id' disabled>foobar</button> is valid html
XML/HTML attribute values are strings. The values “true” and “false” have no special meaning (technically, they aren’t even allowed). The convention is to set the value to the attribute name:
Also note that in your HTML,
<button disabled="">will already disable the button. Just leave out thedisabledattribute or re-enable it with jQuery: