HOME HTML CSS JAVASCRIPT SQL PHP JQUERY XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

HTML <command> Tag


Example

A <command> element can be marked up as follows:

<menu>
<command type="command" label="Save" onclick="save()">Save</command>
</menu>

Try it Yourself »

Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The <command> tag is currently not supported in any of the major browsers.

Note: Internet Explorer 9 (not earlier or later versions), supports the <command> tag.


Definition and Usage

The <command> tag defines a command (a radiobutton, a checkbox, or a command button) that the user can invoke.

A command can be part of a context menu or toolbar, using the <menu> element, or can be put anywhere else in the page, to define a keyboard shortcut.


Differences Between HTML 4.01 and HTML5

The <command> tag is new in HTML5.


Attributes

New : New in HTML5.

Attribute Value Description
checkedNew checked Specifies that the command should be checked when the page loads. Only for type="radio" or type="checkbox"
disabledNew disabled Specifies that the command should be disabled
iconNew URL Specifies an image that represents the command
labelNew text Required. Specifies the name of the command, as shown to the user
radiogroupNew groupname Specifies the name of the group of commands that will be toggled when the command itself is toggled. Only for type="radio"
typeNew checkbox
command
radio
Specifies the type of command

Global Attributes

The <command> tag also supports the Global Attributes in HTML.


Event Attributes

The <command> tag also supports the Event Attributes in HTML.



Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE