HTML <button> Tag

Description

The <button> HTML tag is a fundamental element used to create clickable buttons within web pages. It serves as a user interface element that triggers actions when clicked, such as submitting a form, initiating JavaScript functions, or navigating to another page. Buttons can include text, images, or a combination of both, and they can be customized with CSS to match the overall design of a website. The <button> tag is essential for enhancing user interactivity and providing a clear and accessible way for users to interact with web applications and websites.

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

The following table will show you the current browser support for the HTML <button> tag.

Desktop
Edge Chrome Firefox Opera Safari
1211154
Tablets / Mobile
Chrome Firefox Opera Safari Samsung Webview
184143.214.4

Last updated by CSSPortal on: 30th March 2024