<command>

Obsolete
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.

Note: The command element has been removed from Gecko 24.0 in favor of the <menuitem> element. Firefox has never supported this command element, and the existing implementation of the HTMLCommandElement DOM interface has been dropped from Firefox 24.

Summary

The command element represents a command which the user can invoke.

Attributes

This element includes the global attributes.

checked
Indicates whether the command is selected. Must be omitted unless the type attribute is checkbox or radio.
disabled
Iindicates that the command is not available.
icon
Gives a picture which represents the command.
label
The name of the command as shown to the user.
radiogroup
This attribute gives the name of the group of commands, with a type of radio, that will be toggled when the command itself is toggled. This attribute must be omitted unless the type attribute is radio.
type
This attribute indicates the kind of command. This can be one of three values.
  • command or empty which is the default state and indicates that this is a normal command.

  • checkbox indicates that the command can be toggled using a checkbox.

  • radio indicates that the command can be toggled using a radiobutton.

Examples

<command type="command" label="Save" icon="icons/save.png" onclick="save()">

Specifications

Specification Status Comment
WHATWG HTML Living Standard Living Standard  
HTML5 Candidate Recommendation  

Browser compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support Not supported Not supported Not supported Not supported Not supported
Feature Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support Not supported Not supported Not supported Not supported Not supported

Document Tags and Contributors

Last updated by: kscarfone,