<select name="Food"> <option value ="apples">Apples</option> <option value ="bananas">Bananas</option> <option value ="oranges" disabled>Oranges</option> </select>
The above example demonstrates usage of the
disabled attribute when using the
<option> element. In this example, the Oranges option has been disabled.
disabled attribute is used to disable a given
<option> element. This particular element won't accept changes from the user. It also cannot receive focus and will be skipped when tabbing.
disabled attribute is a boolean attribute. If the attribute is present, its value must either be the empty string or a value that is an ASCII case-insensitive match for the attribute's canonical name, with no leading or trailing whitespace (i.e. either
You can also disable a group of
<option> elements by disabling the