Skip to main content

HTML <command> Tag

Command tag was removed from HTML5

The HTML <command> tag is a deprecated element that was used to define a command that the user can invoke. It was typically used in conjunction with the <menu> element to define a list of commands that could be accessed through a context menu or toolbar.

The <command> tag had several attributes that could be used to define the behavior of the command, such as the "label" attribute, which specified the text label that was displayed to the user, and the "icon" attribute, which specified an icon to be displayed alongside the command.

However, the <command> tag has been deprecated in favor of more modern elements such as the <button> element, which provides similar functionality but is more widely supported and more flexible. It is generally not recommended to use the <command> tag in new development, as it is no longer supported in most modern web browsers.

<!-- This code creates a checkbox widget with "Enable feature" as its label. When clicked, the checkbox will send a message to the server indicating whether or not it has been checked by the user. -->
<command type="checkbox" label="Enable feature"></command>

<!-- This would set up a command that trigger the page's print action (in this case, calling the print() function). -->
<command type="command" onclick="print()"></command>