Select disabled attribute
Definition and Usage
disabled
Attribute setting or return whether the dropdown list should be disabled.
Disabled elements are not available and cannot be clicked. By default, disabled elements are usually displayed in gray in the browser.
This attribute reflects HTML disabled attribute.
See also:
HTML Reference Manual:HTML <select> disabled Attribute
HTML Reference Manual:HTML <select> Tag
Example
Example 1
Disable the dropdown list:
document.getElementById("mySelect").disabled = true;
Example 2
Check if the dropdown list is disabled:
var x = document.getElementById("mySelect").disabled;
Syntax
Return the disabled attribute:
selectObject.disabled
Set the disabled attribute:
selectObject.disabled = true|false
Attribute value
Value | Description |
---|---|
true|false |
Specifies whether the dropdown list should be disabled.
|
Technical Details
Return Value: | Boolean value, returns true if the dropdown list is disabled; otherwise returns false. |
---|
Browser Support
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Support | Support | Support | Support | Support |