Invoker commands
The command and commandfor attributes for the <button> HTML element dispatch an action to an element when the button is invoked (by click or keystroke), as a declarative alternative to addEventListener() calls or onclick attribute handlers.
Status
Baseline Newly Available (since 2025-12-12)
This feature is expected to reach Baseline Widely Available status on: 2028-06-12
MDN documentation
Specifications
- HTML (#attr-button-command), from HTML Workstream (WHATWG).
Browser support
- Chrome 135 Released on 2025-04-01
- Chrome Android 135 Released on 2025-04-01
- Edge 135 Released on 2025-04-04
- Firefox 144 Released on 2025-10-14
- Firefox for Android 144 Released on 2025-10-14
- Safari 26.2 Released on 2025-12-12
- Safari on iOS 26.2 Released on 2025-12-12
Surveys
- State of HTML 2025 > usage > html interoperability features features only
- State of HTML 2025 > usage > html interoperability features
- State of HTML 2025 > interactivity > interactivity pain points limitations 1
- State of HTML 2025 > interactivity > interactivity pain points interop issues 1
- State of HTML 2025 > interactivity > interactivity pain points features
- State of HTML 2025 > interactivity > interactivity pain points
- State of HTML 2025 > interactivity > interactivity features
- State of HTML 2025 > features > all features
View as JSON | Edit this feature | Report an issue | Web-features entry: source, dist