Web platform features explorer

Invoker commands

Limited availability
Tags: api html

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.

Specifications

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
  • Firefox for Android
  • Safari
  • Safari on iOS