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

HTML DOM Button disabled Property

Button disabled Property

Button Object Reference Button Object


Example

Example 1

Disable a button:

Output result:

Try it »


Definition and Usage

The disabled property sets or returns whether the button is disabled.

A disabled element is unavailable and cannot be clicked. Disabled elements are usually displayed in gray in browsers.

Syntax

Set the disabled attribute:

button

.disabled=true|false

Return the disabled attribute:

button

.disabled


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the disabled attribute


Button Object Reference Button Object