<button>Baseline · Widely available
The <button> HTML element represents a button that triggers some action, such as submitting a form or opening a dialog, styled as a labeled rectangular box by default.
Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Jul 29, 2015. Widely available since Jan 29, 2018.
Browser support
DesktopChrome
1+Supportedsince Dec 11, 2008
Current: 155Edge
12+Supportedsince Jul 29, 2015
Current: 154Firefox
1+Supportedsince Nov 9, 2004
Current: 157Safari
1+Supportedsince Jun 23, 2003
Current: 27MobileChrome Android
18+Supportedsince Jun 27, 2012
Current: 155Firefox Android
4+Supportedsince Mar 29, 2011
Current: 157Safari iOS
1+Supportedsince Jun 29, 2007
Current: 27How to use
This feature is Baseline widely available — use it freely, no fallback needed.
Example
Full syntax and examples are on MDN: HTMLButtonElement.
Feature detection
JS · check before using
const el = document.createElement("button");
if (!(el instanceof HTMLUnknownElement)) {
// <button> is supported
}Sub-features
Support for each part of the feature (23). The overall table above shows when the whole feature works.
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| HTMLButtonElement | 1 | 12 | 1 | 3 | 18 | 4 | 1 |
| HTMLButtonElement.disabled | 1 | 12 | 1 | 3 | 18 | 4 | 1 |
| HTMLButtonElement.form | 1 | 12 | 1 | 3 | 18 | 4 | 1 |
| HTMLButtonElement.formAction | 9 | 12 | 4 | 5.1 | 18 | 4 | 5 |
| HTMLButtonElement.formEnctype | 9 | 12 | 4 | 5.1 | 18 | 4 | 5 |
| HTMLButtonElement.formMethod | 9 | 12 | 4 | 5.1 | 18 | 4 | 5 |
| HTMLButtonElement.formNoValidate | 4 | 12 | 4 | 5 | 18 | 4 | 4 |
| HTMLButtonElement.formTarget | 9 | 12 | 4 | 5.1 | 18 | 4 | 5 |
| HTMLButtonElement.labels | 6 | 18 | 56 | 5.1 | 18 | 56 | 5 |
| HTMLButtonElement.name | 1 | 12 | 1 | 3 | 18 | 4 | 1 |
| HTMLButtonElement.type | 1 | 12 | 1 | 3 | 18 | 4 | 1 |
| HTMLButtonElement.value | 1 | 12 | 1 | 3 | 18 | 4 | 1 |
| button | 1 | 12 | 1 | 1 | 18 | 4 | 1 |
| button.disabled | 1 | 12 | 1 | ≤4 | 18 | 4 | ≤3.2 |
| button.form | 9 | 16 | 4 | 5.1 | 18 | 4 | 5 |
| button.formaction | 9 | 12 | 4 | 5.1 | 18 | 4 | 5 |
| button.formenctype | 9 | 12 | 4 | 5.1 | 18 | 4 | 5 |
| button.formmethod | 9 | 12 | 4 | 5.1 | 18 | 4 | 5 |
| button.formnovalidate | 9 | 12 | 4 | 5.1 | 18 | 4 | 5 |
| button.formtarget | 9 | 12 | 4 | 5.1 | 18 | 4 | 5 |
Show 3 more
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| button.name | 1 | 12 | 1 | ≤4 | 18 | 4 | ≤3.2 |
| button.type | 1 | 12 | 1 | ≤4 | 18 | 4 | ≤3.2 |
| button.value | 1 | 12 | 1 | ≤4 | 18 | 4 | ≤3.2 |