tadam logo

HTML <button> disabled Attribute

Example

A disabled button is marked up as follows:
<button type="button" disabled="disabled">Click Me!</button>
The output of the code above will be:

Definition and Usage

The disabled attribute specifies that a button should be disabled.

A disabled button is unusable and un-clickable.

The disabled attribute can be set to keep a user from clicking on the button until some other condition has been met (like selecting a checkbox, etc.). Then, a JavaScript is required to remove the disabled value, and make the button usable.

Browser Support

The disabled attribute supported in all major browsers

Syntax

<button disabled="value">

Attribute Values

ValueDescription
disabledDisables a button
Was this information helpful?
   

Comments