HTML <button> Tag

Description

The <button> HTML element is used for creating a button within forms. For the type attribute, specify either submit (send button), reset (reset button), or button (general purpose push button). The initial value is type = "submit", and a send button is created.

Properties

Permitted Parents
Any element that accepts phrasing content
Content
Any block, inline and text
Start/End Tags
Start tag: required, End tag: required

Example

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

Attributes

Attribute Definition
name Specifies the name for a button.
value Specifies the underlying value of a button.
type

Specifies the type of a button.
Possible Values:

  • button
  • reset
  • submit

Global Attributes

The <button> tag also supports the Global Attributes in HTML5

Event Attributes

The <button> tag also supports the Event Attributes in HTML5

Browser Support

Desktop
Explorer Edge Chrome Firefox Opera Safari
Yes12YesYesYesYes
Tablets / Mobile
Android Chrome Firefox Opera Safari Samsung
YesYesYesYesYesYes

Last updated by CSSPortal on: 6th December 2019