Latest web development tutorials

HTML <command> tag

Examples

<Command> can be labeled as follows:

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

try it"

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Currently, the mainstream browsers do not support <command> tag.

Note: Only IE 9 supports <command> tag, or other previous version after version of IE browser does not support <command> tag.


Tag definitions and instructions

<Command> tag to define a command (such as radio buttons, check boxes or button) the user may call.

When using the <menu> element, command element as part of the menu or the toolbar is displayed. However, when the command specified by keyboard shortcuts, command element can be placed anywhere on the page, but the elements are not visible.


Differences between HTML 4.01 and HTML5

<Command> tag is new in HTML 5 tag.


Attributes

New: HTML5 new property.

属性 描述
checked New checked 规定当页面加载时,command 是否被选中。仅用于 radio 或 checkbox 类型。
disabled New disabled 规定 command 是否可用。
icon New URL 规定作为 command 来显示的图像的 URL。
label New text 必需。规定 command 的名字,对用户可见。
radiogroup New groupname 规定可进行切换且将被切换的 command 所属的组名。仅在类型为 radio 时使用。
type New checkbox
command
radio
定义 command 的类型。默认是 "command"。

Global Properties

<command> tag supports HTML global properties .


Event Properties

<command> tag supports HTML event properties .