The html5 tutorials

 
About HTML5
Home
Introduction to HTML5
Features of HTML5
Older versions Vs. HTML5
 
Tags  
source
article
aside
audio
canvas
command
datalist
details
embed
figcaption
figure
footer
header
hgroup
keygen
mark
meter
nav
output
progress
ruby
section
summary
time
video
wbr
 

The <command> Tag

The command tag is used to represent a command like a checkbox, radio button or any other button that the user can interact with.

There is one criterion which must be met while making a command- it should be inside a menu element, else it won't get displayed on the page in the browser. It simply means that a menu contains a command element and this could not be vice versa.

Example code:

<html>
  <body>
    <menu>
      <command type="command">Click here for more info on HTML5!</command>
    </menu>
  </body>
</html>

Attributes of Command tag

The <command> Tag comes with the various attributes as given in the below table

Attribute Values Description of the attribute
type checkbox, command, radio Indicates the type of command & the default value in command. Checkbox is for checking the box and radio is for clicking inside a radio box
checked checked It is used only when the type is a radio or a checkbox and defines if the respective command button is checked or not
disabled disabled This is a Boolean attribute that indicates that the command is not available in the current form, i.e. disabled.
label command name Gives the name of the command as it would be shown to the user. It should be explicitly mentioned and must not be empty
icon url Gives a picture or image that represents the command. It should contain a valid non empty URL.
radiogroup name of the radiogroup It provides a name of the radiogroup that particular command belongs to. It can be used only if the command is a radio one.