Latest web development tutorials

HTML option disabled property

Tag Reference HTML option HTML <option> tag

Examples

Drop-down list with four options, one option has been disabled:

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

try it"

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the disabled attribute.

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


Definition and Usage

disabled attribute is a Boolean attribute.

disabled attribute specifies an option should be disabled.

Disabled options are neither available, nor click.

You can set the disabled property until certain conditions are met (such as selecting a check box), was restored to the user the option to use. You can then use JavaScript to remove the disabled attribute so that the option becomes available.


Differences between HTML 4.01 and HTML5

no.


Differences between HTML and XHTML

In XHTML, prohibit attribute minimization, disabled attribute must be defined as <option disabled = "disabled">.


grammar

<option disabled>


Tag Reference HTML option HTML <option> tag