HTML <optgroup> disabled attribute
HTML <optgroup> tag
Example
A disabled option group:
<select>
<optgroup label="German Cars" disabled="disabled">
<option value="mercedes">Mercedes</option>
<option value="audi">Audi</option>
</optgroup>
</select>
|
Try it yourself!
|
Definition and Usage
The disabled attribute specifies that an option group should be disabled.
A disabled option group is unusable and un-clickable.
The disabled attribute can be set to keep a user
from selecting from the option group until some other condition has been met (like selecting a
checkbox, etc.). Then, a JavaScript is required to remove the disabled value,
and make the option group selectable.
Browser Support
The disabled attribute is supported by all major browsers, except Internet Explorer.
Note: Not supported in Safari 2.0 or earlier versions. Supported in IE
8 (beta) and newer versions.
Syntax
<optgroup disabled="value">
|
Attribute Values
Value |
Description |
disabled |
Disables the option group |
HTML <optgroup> tag
|