Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

What is the use of <command> tag in HTML5?

user-image
Question added by Febin Joy , Sr.Software Engineer , NetProMedia Advertising Pvt Ltd
Date Posted: 2015/05/27
kareem zock
by kareem zock , Founder & Blogger , Techwebies

 

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.

The command element is meant to encapsulate something that you can do.It provides an abstraction layer between UI and commands, so that you can make multiple UI elements refer to the same command.

Manal Abuelazaem
by Manal Abuelazaem , Application Developer and Owner , ManalSoft

<command > is a new tag added in HTML5 but still not supported in most browsers. It is used to represent a command that the user can invoke. It is almost an obsolete element that may be deprecated in the coming few years.

irfan shaikh
by irfan shaikh , Consultant : Senior Web Designer/Front end Developer , Client : ● Impact Proximity, Dubai ● Cube Solution, Dubai ● WAC, Sharjha ● KIOEC, Kuwait ● IRIS Ltd.

It provides the layer of abstraction between UI (menu items, buttons, and links) & Command With command you can target multiple UI elements with same command this will allow single feature to many access point.

 

The command tag was introduced in HTML5 but later removed & not recommended to use.

Mohamed Abdelnour
by Mohamed Abdelnour , UI/UX Specialist , DXC Technology previously known as (Hewlett-Packard Enterprise)

the <command> element is meant to be an abstraction to let us refer to the same "command" from multiple menu entries or buttons.

the <command> can be part of a context menu or toolbar, using the menu element, or can be put anywhere else in the page, to define a keyboard shortcut.

George Dimitrov
by George Dimitrov , Unix System Administrator , ADVANCED.IO

The type attribute is currently not supported in any of the major browsers. The <command> element has now been dropped from the HTML5 specification. Therefore, you should not use it in your HTML markup.

 

There are3 kinds of attributes that you can add to your HTML tags: Element-specific, global, and event handler content attributes. The attributes that you can add to this tag are listed below.

 

<command type="command|checkbox|radio">

 

If a <command> element slave has a command attribute, and slave is in a Document, and there is an element in that Document whose ID has a value equal to the value of slave's command attribute, and the first such element in tree order, hereafter master, itself defines a command and either is not a <command> element or does not itself have a command attribute, then the master command of slave is master.

 

An element with a command attribute must have a master command and must not have any type, label, icon, disabled, checked, or radiogroup attributes.

 

mahboob khan
by mahboob khan , Project Student Information System , TekNords Inc Swat.K.P.K

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

Md Raju Molla
by Md Raju Molla , Web designer & Developer , Mizan IT Limited

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

Mohammad Arif
by Mohammad Arif , Principal Engineer UI , NatWest Group

This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.

 

Source - https://developer.mozilla.org/en-US/docs/Web/HTML/Element/command

Faisal Rashid Ahmad
by Faisal Rashid Ahmad , Networking & Information Technology , Saudi Kinda.co

  1. command is the abstraction behind menu items, buttons, and links. Once a command is defined, other parts of the interface can refer to the same command, allowing many access points to a single feature to share aspects such as the disabled state.
  2. The command element is meant to encapsulate something that you can do. It can be rendered within a menu (since a menu presents items you can invoke).
  3. It provides an abstraction layer between UI and commands, so that you can make multiple UI elements refer to the same command. 
  4. This gives you the flexibility of having one command element, rendered in a menu, that is also invoked via a URL in the middle of the page as well as a button at the bottom of the page. Disabling the command disables all access paths (url/button/menu) to the action behind the command.
  5. The <command> element is meant to be an abstraction to let you refer to the same "command" from multiple menu entries or buttons.
  6. The <command> is supported only in IE9 browser.

More Questions Like This