English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Reference Manual

Complete List of HTML Tags

HTML: <button> disabled Attribute

The disabled attribute is a boolean (boolean) attribute. If this attribute is used, the button will be disabled, and the disabled button cannot be used and cannot be clicked. The disabled attribute can be set so that the button can be clicked when certain conditions are met (such as checking the checkbox, etc.).

 HTML <button> tag

Online Example

Disabled button:

<!DOCTYPE html>
<html>
<head>
<title>HTML:<button> disabled Attribute - 基础教程网 oldtoolbag.com</title>
<body>
<button type="button" disabled>Click Me!/button>
</body>
</html>
Test and see ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

All major browsers support the disabled attribute

Definition and Usage

The disabled attribute is a boolean (boolean) attribute.

If this attribute is used, the button will be disabled.

Disabled buttons are unusable and cannot be clicked.

The disabled attribute can be set to allow users to click the button only when certain conditions are met (such as checking a checkbox, etc.). Then, JavaScript can be used to remove the disabled attribute, making the button available again.

HTML 4.01 with HTML5differences

None.

Differences between HTML and XHTML

In XHTML, attributes are not allowed to be abbreviated, the disabled attribute must be defined as <button disabled="disabled">.

Syntax

<button disabled>

 HTML <button> tag