HTML element: <button>
Attributes
Attribute |
Value(s) |
Description |
Availability |
|---|---|---|---|
disabled |
— |
When specified, this attribute disables the button so that it cannot be clicked. |
4.6 or later |
name |
text |
This attribute defines a unique name for the button. |
4.0 or later |
type |
button reset submit |
This attribute defines the button type. The default value is submit. |
4.6 or later |
value |
text |
This attribute specifies an initial value for the button. The value can be changed by a script. |
4.6 or later |
Common attributes
The <button> element supports the class, dir, id, lang, style, and title attributes.
For more information, see Common attributes.
Event attributes
The <button> element supports the onblur, onclick, onfocus, onkeydown, onkeypress, onkeyup, onmousedown, onmousemove, onmouseout, onmouseover, and onmouseup events.
For more information, see HTML event attributes.