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 ❌ Vendor position : positive
- Firefox for Android ❌ Vendor position : positive
- Safari ❌ Vendor position : support
- Safari on iOS ❌ Vendor position : support
Developer signals
- State of HTML 2025: reading_list/reading_list question
- State of HTML 2025: features/all_features question
View as JSON | Edit this feature | Report an issue | Web-features entry: source, dist