HOME HTML HTML5 CSS XML JAVASCRIPT ASP PHP SQL REFERENCES | EXAMPLES | FORUM | ABOUT

HTML5 <command> Tag

Example

A button is marked up as follows:

<menu>
<command onclick="alert('Hello World')">
Click Me!</command>
</menu>

Try it yourself »

Definition and Usage

The <command> tag defines a command button, like a radiobutton, a checkbox, or a button.

The command element is only visible if it is inside a menu element. If not, it will not be displayed, but can be used to specify 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 Defines if the command is checked or not. Use only if type is radio or checkbox
disabledNew disabled Defines if the command is available or not
iconNew url Defines the url of an image to display as the command
labelNew name Defines a name for the command. The label is visible
radiogroupNew radiogroup Defines the name of the radiogroup this command belongs to. Use only if type is radio
typeNew checkbox
command
radio
Defines the type of command. Default value is 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.


Examples

» HTML Examples
» CSS Examples
» XML Examples
» JavaScript Examples
» HTML DOM Examples
» XML DOM Examples
» DHTML Examples
» AJAX Examples
» VBScript Examples
» ASP Examples
» ADO Examples
» ASP.NET Examples
» SVG Examples
w3cTutorial.com HOME | FORUM | ABOUT
w3cTutorial is optimized for learning, testing, and training. Examples might be simplified to improve reading and basic understanding.
Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content.
While using this site, you agree to have read and accepted our terms of use and privacy policy.
Copyright 2011 W3CTutorial.COM. All Rights Reserved.