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

HTML button disabled attribute

HTML

HTML button Tag Reference HTML

Try it »


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the disabled property


Definition and Usage

The disabled attribute is a boolean attribute.

If this attribute is used, the button is disabled.

A disabled button is unusable and unclickable.

The disabled attribute can be set so that the user can only click the button after certain conditions are met (such as checking a checkbox, etc.). Then, JavaScript can be used to remove the disabled attribute to make the button usable.


Differences between HTML 4.01 and HTML5

NONE.


Differences between HTML and XHTML

In XHTML, attribute shorthand is not allowed; the disabled attribute must be defined as