command

The HTML command element was once proposed for commands in a menu, but it is not part of the current HTML standard. This page explains how to read old examples and what to use today.

What you will learn

Do not use command in new pages

The element was associated with an earlier menu-command design and never became a dependable choice for modern sites. Browsers, validators, and assistive technologies should not be expected to provide a consistent implementation.

<!-- Historical example: do not copy this into a new page -->
<command type="command" label="Save">

Choose the modern element by purpose

Run an action on the current page
Use <button type="button"> and connect behavior with JavaScript when needed.
Submit a form
Use <button type="submit"> inside the form.
Navigate to another resource
Use an <a href="..."> link.
Show a list of commands
Use a semantic list and buttons or links, or use the modern menu patterns supported by your design.

Why this page is still useful

Reference sites often contain old elements because specifications changed over time. Knowing that command is obsolete helps you avoid copying code that looks official but is not a reliable foundation today.

Common mistakes

Related pages