HTML <input>
disabled
Attribute
Example
An HTML form with a disabled input field:
Browser Support
All major browsers support the disabled
attribute.
Definition and Usage
The disabled
attribute is a boolean attribute.
The disabled
attribute specifies that the <input>
element should be disabled.
A disabled input element is unusable and un-clickable.
The disabled
attribute is set to make the <input>
element unusable until certain conditions are met (like selecting a checkbox, etc.). Then, a JavaScript can remove the disabled
value, and make the <input>
element usable.
Tip: Disabled <input>
elements in a form will not be submitted.
Note: The disabled
attribute is not applicable to <input type="hidden">
.
Differences Between HTML 4.01 and HTML5
None.
Differences Between HTML and XHTML
In XHTML, attribute minimization is forbidden, and the disabled
attribute must be defined as <input disabled="disabled" />
.