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.
|
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 | |||||
12 | 1 | 1 | 15 | 4 |
Tablets / Mobile | |||||
18 | 4 | 14 | 3.2 | 1 | 4.4 |
Last updated by CSSPortal on: 30th March 2024