Input Number disabled
Attribute
Example
Disable the number field:
Result output:
Definition and Usage
The disabled
attribute is used to set or return whether the number field is disabled.
Elements with the disabled
attribute are unusable and unclickable. Disabled elements are typically displayed in a grayed-out state in the browser.
This attribute reflects the HTML disabled
attribute.
Browser Support
All major browsers support the disabled
attribute.
Note: Internet Explorer 9 and earlier versions do not support the <input>
element with the type="number"
attribute.
Syntax
Return the disabled
attribute:
Set the disabled
attribute:
Attribute Values
Value | Description | |
---|---|---|
true | false | Describes whether the number field is available. true - The number field is unavailable<br>false - Default. The number field is available |
Technical Details
| Return Value: | Boolean, returns true if the number field is unavailable, otherwise returns false | | --- | --- |
More Examples
Example
Check if the number field is available:
Example
Disable or enable the number field:
Related Pages
HTML Reference: HTML <input> disabled Attribute