HTML <optgroup> disabled Attribute
Example
<select>
<optgroup label="Group 1">
<option>Option 1.1</option>
</optgroup>
<optgroup label="Group 2">
<option>Option 2.1</option>
<option>Option 2.2</option>
</optgroup>
<optgroup label="Group 3" disabled>
<option>Option 3.1</option>
<option>Option 3.2</option>
<option>Option 3.3</option>
</optgroup>
</select>
Meaning
The disabled Occurrence of this attribute specifies that the enclosed set of options is disabled.
And this is Boolean attribute, if it is set none of the items in this option group is selectable.
Often browsers grey out such control and it won't receive any browsing events, like mouse clicks or focus-related ones.
Standard Syntax
<select>
<optgroup label="text" disabled>
<option>text</option>
</optgroup>
</select>
Advertisement
Attribute Values
| Value | Description |
|---|---|
| disabled | This is a boolean attribute, the presence of a boolean attribute on an element represents the true value, and the absence of the attribute represents the false value. |