Volvo "> Volvo " />
Easy Tutorial
❮ Att Basefont Face Att Input Type ❯

HTML <option> disabled Attribute

HTML <option> Tag

Example

A drop-down list with 4 options, one of which is disabled:

<select>
    &lt;option value="volvo" disabled>Volvo</option>
    <option value="saab">Saab</option>
    <option value="vw">VW</option>
    <option value="audi">Audi</option>
</select>

Browser Support

All major browsers support the disabled attribute.

Note: Internet Explorer 7 and earlier versions do not support the disabled attribute for the <option> tag.


Definition and Usage

The disabled attribute is a boolean attribute.

The disabled attribute specifies that an option should be disabled.

A disabled option is unusable and unclickable.

The disabled attribute can be set to keep a user from selecting the option until some other condition has been met (like selecting a checkbox, etc.). Then, a JavaScript could remove the disabled value, and make the option selectable.


Differences Between HTML 4.01 and HTML5

None.


Differences Between HTML and XHTML

In XHTML, attribute minimization is forbidden, and the disabled attribute must be defined as <option disabled="disabled">.


Syntax

❮ Att Basefont Face Att Input Type ❯