HTML.lt;button and disabled properties

HTML button disabled property HTML slt;button-and-label

The disabled property, which controls whether buttons in HTML documents are interactive, is a value of the boolean type, and you can refer to the following example:

Disable a button:

<button type="button" disabled>点我!</button>

Try it out . . .

Browser support

HTML button disabled property HTML button disabled property HTML button disabled property HTML button disabled property HTML button disabled property

The disabled property is supported by all major browsers


Definitions and usages

The disabled property is a boolean property.

If you use this property, the button is disabled.

Disabled buttons are unavailable and unable to click.

You can set the disabled property so that users can click the button when certain conditions are met (such as check boxes, etc.). You can then use JavaScript to remove the disabled property and make the button available.


The difference between HTML 4.01 and HTML5

No.


The difference between HTML and XHTML

In XHTML, the property does not allow short writing, and the disabled property must be defined as the "disabled" of the .lt;button disabled.


Grammar

<button disabled>

HTML button disabled property HTML slt;button-and-label