The disabled attribute on an <optgroup> tag disables the optgroup and its options.
The options appear dimmed and are not selectable.
An <optgroup> element with a disabled attribute.
None of the options inside the first option group are selectable.
<select>
<option value="">-- Select City --</option>
<optgroup label="Europe" disabled>
<option value="stockholm">Stockholm</option>
<option value="barcelona">Barcelona</option>
<option value="athens">Athens</option>
</optgroup>
<optgroup label="Asia">
<option value="bangkok">Bangkok</option>
<option value="manila">Manila</option>
<option value="jakarta">Jakarta</option>
</optgroup>
</select>
The disabled attribute specifies that the option group is disabled.
All of its child options are disabled and cannot be selected.
<optgroup disabled>
<optgroup disabled="disabled">
Value | Description |
---|---|
disabled | Use value 'disabled' or no value at all. Both are valid. |
Here is when disabled support started for each browser:
Chrome
|
1.0 | Sep 2008 |
Firefox
|
1.0 | Sep 2002 |
IE/Edge
|
8.0 | Mar 2009 |
Opera
|
1.0 | Jan 2006 |
Safari
|
1.0 | Jan 2003 |