Hasty Briefsbeta

Bilingual

Invoker Commands API

3 days ago
  • #javascript
  • #web-development
  • #html-api
  • The Invoker Commands API allows declarative assignment of behaviors to buttons for controlling interactive elements.
  • Common uses include controlling popovers, dialogs, and text formatting without requiring JavaScript event listeners.
  • Key HTML attributes: `commandfor` (specifies the element to control) and `command` (specifies the action to perform).
  • The `CommandEvent` interface represents an event fired when a command is issued.
  • Examples include creating declarative popovers, dialogs, and custom commands like rotating an image.
  • Browser compatibility and specifications are provided for `CommandEvent`, `command`, and `commandForElement`.