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

HTML DOM Select disabled Property

Select disabled Property

Select Object Reference Select object


Example

Example 1

Disable the drop-down list:

document

.

getElementById

(

"

mydrop

"

)

.

disabled

=

true

;

Output result:

Cats Dogs

Try it »


Definition and Usage

The disabled property sets or returns whether the drop-down list is disabled.

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


Select Object Reference Select object