HTML5 <command> Tag

Example

A button coded as below::

<menu>
<command onclick="alert('Hai Everyone')">
Hai Everyone!</command>
</menu>
Code it Online »

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

Attribute Value Description
checked checked Defines if the command is checked or not. Use only if type is radio or checkbox
disabled disabled Defines if the command is available or not
icon url Defines the url of an image to display as the command
label name Defines a name for the command. The label is visible
radiogroup radiogroup Defines the name of the radiogroup this command belongs to. Use only if type is radio
type checkbox
command
radio
Defines the type of command. Default value is command

Standard Attributes

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

Event Attributes

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


Have Any Suggestion? We Are Waiting To Hear from YOU!

Your Query was successfully sent!