References

Collection of references for web development.

HTML button tag

Description

The HTML <button> element represents a clickable button.

Attributes

Attribute Value Description
autocomplete on
off
Specifies if form elements should be automatically completed by the browser.
autofocus boolean Specifies if the element should automatically have focus when the document loads.
disabled boolean Specifies whether the element should be disabled or not (user is unable to click or control if disabled).
form ID Specifies the form(s) that the element belongs to.
formaction URL Specifies where to send the data.
formenctype application/x-www-form-urlencoded
multipart/form-data
text/plain
Specifies what type of content is used when submitting the data. Type=submit only!
formmethod post
get
Specifies what method to use when submitting the data. Type=submit only!
formnovalidate boolean Specifies that the data should not be validated on submit. Type=submit only!
formtarget _self
_blank
_parent
_top
framename
Specifies where to display the response that is received after submitting the data. Type=submit only!
name string Specifies the name of the element.
type submit
reset
button
Specifies the type of the button.
value value Specifies the value of the element.

Example

<button name="button" type="button">Click Me</button>