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
Limited availability
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 ❌ Vendor position : support
- Safari on iOS ❌ Vendor position : support
Baseline availability blocked since October 2025 by Safari (2 months)
Developer signals
- State of HTML 2025: usage/html_interoperability_features_features_only question
- State of HTML 2025: usage/html_interoperability_features question
- State of HTML 2025: interactivity/interactivity_pain_points_interop_issues_1 question
- State of HTML 2025: interactivity/interactivity_pain_points_features question
- State of HTML 2025: interactivity/interactivity_features question
- State of HTML 2025: features/all_features question
Developer signals
Votes: 11
If you want this feature to be available in all browsers, vote for it by adding a thumbs up reaction (👍) to this GitHub issue, and leave a comment with more information.
View as JSON | Edit this feature | Report an issue | Web-features entry: source, dist