HTML Tag: button
Button form control that contains, and is labelled by, content.
Optional Attributes
Attribute | Description | Possible values |
---|---|---|
name |
Name of the form control, to be paired with its value. | Text (no spaces). |
type |
The type of button. |
|
value |
Used when type is submit . The button’s value, sent when the button is used to submit its associated form. |
Text. |
disabled |
Disables the form control. | None. |
autofocus |
Indicates that the form control should have focus on page load. Should only be used on one form control in a page. | None. |
form |
Explicitly associates the control to a form element, which it may or may not be nested within. If absent, the control will be associated to its form ancestor. |
Text matching the value of a form element’s id attribute. |
formaction |
Used when type is submit . The address to which submitted form data should be sent to. Will override a form element’s action attribute. |
URL. |
formmethod |
Used when type is submit . The HTTP method by which submitted form data should be sent. Will override a form element’s method attribute. |
|
formenctype |
Used when type is submit . The MIME type used to encode the form data. Will override a form element’s enctype attribute. |
|
formnovalidate |
Used when type is submit . Indicates that the form should not be validated before it is submitted. Will override a form element’s novalidate attribute. |
None. |
formtarget |
Used when type is submit . The browsing context in which the submitted form’s destination URL should open. Will override a form element’s target attribute. |
|
Global attributes |
Example
<button>Push my <strong>button</strong>, baby</button>