The disabled attribute on an <option> tag disables the option.
It appears dimmed and is unselectable.
A disabled attribute on 2 <option> tags.
The last 2 options cannot be selected.
<select>
<option value="">-- Select City --</option>
<option value="newyork">New York</option>
<option value="losangeles">Los Angeles</option>
<option value="chicago" disabled>Chicago</option>
<option value="houston" disabled>Houston</option>
</select>
The disabled attribute specifies that the option is disabled.
The option appears grayed out and cannot be selected.
<option disabled>
<option 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 |
Back to <option>