Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Option disabled Property

Option disabled Property

Option Object Reference Option Object


Example

Example 1

Disable the second option in the dropdown list:

Output result:

Cat Dog Horse

Try it »


Definition and Usage

The disabled property sets or returns whether a certain option is disabled by default

A disabled input element is neither usable nor clickable. The disabled attribute can be set until some other condition is met (such as selecting a checkbox, etc.).

Syntax

Set the disabled attribute:

element

.disabled=true|false

Return the disabled attribute:

element

.disabled


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the disabled attribute


Option Object Reference Option Object