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
- That
commandwas removed from the current specification - How to interpret it when you encounter it in old material
- Which modern elements replace its intended use
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
menupatterns 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
- Treating an old browser example as current HTML guidance.
- Using
commandinstead of a real button or link. - Expecting an obsolete element to provide keyboard and accessibility behavior automatically.
- Confusing the removed element with ordinary English documentation that calls an action a “command.”