A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.cdn.mozilla.net/en-US/docs/Web/API/CommandEvent/command below:

CommandEvent: command property - Web APIs

CommandEvent: command property

Limited availability

The command read-only property of the CommandEvent interface returns a string containing the value of the command property at the time the event was dispatched.

Value

A string.

Examples

In the following simple example we've set up an event listener to listen for the "show-modal" command:

document.body.addEventListener(
  "command",
  (event) => {
    const theAction = event.command;

    if (theAction === "show-modal") {
      console.log("Showing modal dialog");
    }
  },
  { capture: true },
);
Specifications Browser compatibility See also

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4