W3Schools.com

HTML5 <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 only supported by Internet Explorer 9.


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 HTML5.


Event Attributes

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



W3Schools Certification

W3Schools' Online Certification

The perfect solution for professionals who need to balance work, family, and career building.

More than 10 000 certificates already issued!

Get Your Certificate »

The HTML Certificate documents your knowledge of HTML.

The CSS Certificate documents your knowledge of advanced CSS.

The JavaScript Certificate documents your knowledge of JavaScript and HTML DOM.

The jQuery Certificate documents your knowledge of jQuery.

The XML Certificate documents your knowledge of XML, XML DOM and XSLT.

The ASP Certificate documents your knowledge of ASP, SQL, and ADO.

The PHP Certificate documents your knowledge of PHP and SQL (MySQL).

WEB HOSTING
Best Web Hosting
PHP MySQL Hosting
Best Hosting Coupons
UK Reseller Hosting
Cloud Hosting
Top Web Hosting
$7.95/mo SEO Hosting
Premium Website Design
WEB BUILDING
Download XML Editor
FREE Website BUILDER
Free Website Templates Free CSS Templates
Make Your Own Website
W3SCHOOLS EXAMS
Get Certified in:
HTML, CSS, JavaScript, XML, PHP, and ASP
W3SCHOOLS BOOKS
New Books:
HTML, CSS
JavaScript, and Ajax
STATISTICS
Browser Statistics
Browser OS
Browser Display
SHARE THIS PAGE