Invoker Commands
A declarative HTML command proposal that allows buttons to send commands to target elements through the command and commandfor attributes, enabling control of interactions for elements such as dialog and popover without JavaScript.
Timeline (last 90 days)
Invoker Commands specifies the command to send and the target element ID by setting the command and commandfor attributes on a button.
Invoker Commands command names mirror the corresponding JavaScript method names, but change camelCase to hyphenated form, for example showModal() becomes show-modal.
Invoker Commands is already supported in Chrome 135, Firefox Nightly and Safari Technology Preview.
Keith Cirkel wrote a polyfill for Invoker Commands; it is a module that takes effect on load, with no additional configuration steps.
Commands prefixed with two hyphens (such as command="--scroll-down") are treated as custom commands and require JavaScript to listen for the command event on document to handle them.
The command event is a new event type introduced by Invoker Commands; it is dispatched on the triggering element and bubbles to document, carrying properties such as command and source.
All Facts (6)
Invoker Commands specifies the command to send and the target element ID by setting the command and commandfor attributes on a button.
50%UnverifiedInvoker Commands command names mirror the corresponding JavaScript method names, but change camelCase to hyphenated form, for example showModal() becomes show-modal.
50%UnverifiedInvoker Commands is already supported in Chrome 135, Firefox Nightly and Safari Technology Preview.
50%UnverifiedKeith Cirkel wrote a polyfill for Invoker Commands; it is a module that takes effect on load, with no additional configuration steps.
50%UnverifiedCommands prefixed with two hyphens (such as command="--scroll-down") are treated as custom commands and require JavaScript to listen for the command event on document to handle them.
50%UnverifiedThe command event is a new event type introduced by Invoker Commands; it is dispatched on the triggering element and bubbles to document, carrying properties such as command and source.
50%