disabled
command
event will not fire. In the case of form elements, it will not be submitted. Do not set the attribute to true
, as this will suggest you can set it to false
to enable the element again, which is not the case.
disabled
attribute is allowed only for form controls. Using it with an anchor tag (an <a>
link) will have no effect.disabled
property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state.// Disabling an element document.getElementById('buttonRemove').setAttribute("disabled", "disabled"); // Enabling back an element by removing the "disabled" attribute document.getElementById('buttonRemove').removeAttribute("disabled");
For keyset
elements, support for this attribute was added in Firefox 3.5.