English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The command element is used to represent a command that a user can call.
The <command> tag can be marked as follows:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Basic Tutorial(oldtoolbag.com)</title> <script> function save() { alert("Some JavaScript...."); } </script> </head> <body> <menu> <command type="command" label="Save" onclick="save()">Save</command> </menu> <p><b>Attention:</b>Only IE 9 Supports the command tag.</p> </body> </html>Test and see ‹/›
IEFirefoxOperaChromeSafari
Currently, mainstream browsers do not support the <command> tag.
Note:Only IE 9 Supports the <command> tag, other IE browsers of previous or later versions do not support the <command> tag.
The <command> tag can define commands that users may call (such as radio buttons, checkboxes, or buttons).
When using the <menu> element, the command element is displayed as part of the menu or toolbar. However, when defining keyboard shortcuts with command, the command element can be placed at any position on the page, but the element is not visible.
<command> tag is a part of HTML 5 new tag in
New : HTML5 new attribute in
Attribute | Value | Description |
---|---|---|
checkedHTML5 | checked | Specify whether the command is selected when the page is loaded. Used only for radio or checkbox types. |
disabledHTML5 | disabled | Specify whether the command is available. |
iconHTML5 | URL | Specify the URL of the image to be displayed as the command. |
labelHTML5 | text | Required. Specify the name of the command, visible to the user. |
radiogroupHTML5 | groupname | Specify the group name of the command that can be toggled and will be toggled. Used only when the type is radio. |
typeHTML5 | checkbox command radio | Define the type of command. The default is "command". |
Support for <command> tag Global Attributes of HTML.
Support for <command> tag HTML Event Attributes.