HTML5 command example

HTML5 command Element Tutorial

HTML5 command element represents a command which can be called or executed by user.

Usage

Whether start and end tag are required

It must have a start tag. And should not have an end tag.

What an command element can contain

This is a void element. So, it can not contain any content.

Which elements can contain command element

Any element that accepts phrasing content.

Attributes

Following table shows the detail of attributes supported by command element.

Attribute Description
checked This attribute can be used if the value of the type attribute is checkbox or radio. This attribute indicates whether the associated command is selected.
disabled If used, it is an indication that the command is not available.
icon An image representing the command.
label A name given to the command for users.
radiogroup Can be used if the value of the type attribute is radio. It gives the name of the group of commands.
type Indicates the type of the command. Values can be empty, command, checkbox, radio. If the command or empty, it indicates that this is a normal command. This is also the default. If the value is a checkbox, it indicates that the command is usable through a checkbox. And if the value is radio, then the command can be used through a radio.
Читайте также:  Default functions php wordpress

Example:

    function run() 

Compatibility

Command element is not supported by any of the major and most widely used browsers till now.

Test your Programming skills with w3resource’s quiz.

Follow us on Facebook and Twitter for latest update.

  • Weekly Trends
  • Java Basic Programming Exercises
  • SQL Subqueries
  • Adventureworks Database Exercises
  • C# Sharp Basic Exercises
  • SQL COUNT() with distinct
  • JavaScript String Exercises
  • JavaScript HTML Form Validation
  • Java Collection Exercises
  • SQL COUNT() function
  • SQL Inner Join
  • JavaScript functions Exercises
  • Python Tutorial
  • Python Array Exercises
  • SQL Cross Join
  • C# Sharp Array Exercises

We are closing our Disqus commenting system for some maintenanace issues. You may write to us at reach[at]yahoo[dot]com or visit us at Facebook

Источник

Elements/command

The element represents a command that the user can invoke.

Point

  • A 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.

HTML Attributes

  • type = command/ checkbox/ radio
    Indicates the kind of command:
    • command
      Normal command with an associated action.
    • checkbox
      State or option that can be toggled.
    • radio
      Selection of one item from a list of items.
    • label = string
      Gives the name of the command, as shown to the user.
      The label attribute must be specified and must have a value that is not the empty string.
    • icon = valid non-empty URL potentially
      Gives a picture that represents the command.
    • disabled = boolean
      If present, indicates that the command is not available in the current state.
    • checked = boolean
      If present, indicates that the command is selected.
      The attribute must be omitted unless the type attribute is in either the Checkbox state or the Radio state.
    • radiogroup = string
      Gives the name of the group of commands that will be toggled when the command itself is toggled, for commands whose type attribute has the value «radio».

    Also, the title attribute has special semantics on this element.

    Источник

    Тег command

    Позволяет создать кнопку в виде чек-бокса, переключателя или другой разновидности, в зависимости от значения его ключевых параметров. Работает только под родительством menu, иначе тег выводится не будет.

    Как правильно задавать?

    menu> command ключевые параметры> menu>

    Какие атрибуты поддерживаются?

    • checked — запускает работу тега для типов checkbox или radio.
    • disabled — блокировка работы тега.
    • icon — картинка, заданная для текущей операции.
    • label — имя операции.
    • radiogroup — объединяет комплекс активных флажков для определенного типа — radio.
    • type — назначает вид операции. Доступны всего 3 вида:checkbox, command, radio. Изначально присваивается тип command.

    Пример использования

    DOCTYPE html> html> head> meta charset="utf-8"> title>Тег commandtitle> head> body> menu> command onclick="alert('Скакать!')" label="Исполнить команду 1"> command onclick="alert('Устранить тех, кто скачет!')" label="Исполнить команду 2"> menu> body> html>

    Источник

    HTML 5 Tag

    The HTML tag is used for specifying a command that the user can invoke.

    According to the HTML 5 specification:

    A 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.

    The tag was introduced (and subsequently dropped) in HTML 5.

    The element has now been dropped from the HTML5 specification. Therefore, you should not use it in your HTML markup. I have decided to keep this page for information purposes only.

    Attributes

    HTML tags can contain one or more attributes. Attributes are added to a tag to provide the browser with more information about how the tag should appear or behave. Attributes consist of a name and a value separated by an equals (=) sign, with the value surrounded by double quotes. Here’s an example, style=»color:black;» .

    There are 3 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.

    Element-Specific Attributes

    The following table shows the attributes that are specific to this tag/element.

    This is a boolean attribute. If the attribute is present, its value must either be the empty string or a value that is an ASCII case-insensitive match for the attribute’s canonical name, with no leading or trailing whitespace (i.e. either disabled or disabled=»disabled» ).

    This is a boolean attribute. If the attribute is present, its value must either be the empty string or a value that is an ASCII case-insensitive match for the attribute’s canonical name, with no leading or trailing whitespace (i.e. either checked or checked=»checked» ).

    If a 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 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.

    Global Attributes

    The following attributes are standard across all HTML 5 tags.

    • accesskey
    • class
    • contenteditable
    • contextmenu
    • dir
    • draggable
    • dropzone
    • hidden
    • id
    • itemid
    • itemprop
    • itemref
    • itemscope
    • itemtype
    • lang
    • spellcheck
    • style
    • tabindex
    • title
    • translate

    For a full explanation of these attributes, see HTML 5 global attributes.

    Event Handler Content Attributes

    Event handler content attributes enable you to invoke a script from within your HTML. The script is invoked when a certain «event» occurs. Each event handler content attribute deals with a different event.

    Here are the standard HTML 5 event handler content attributes.

    • onabort
    • oncancel
    • onblur
    • oncanplay
    • oncanplaythrough
    • onchange
    • onclick
    • oncontextmenu
    • ondblclick
    • ondrag
    • ondragend
    • ondragenter
    • ondragexit
    • ondragleave
    • ondragover
    • ondragstart
    • ondrop
    • ondurationchange
    • onemptied
    • onended
    • onerror
    • onfocus
    • onformchange
    • onforminput
    • oninput
    • oninvalid
    • onkeydown
    • onkeypress
    • onkeyup
    • onload
    • onloadeddata
    • onloadedmetadata
    • onloadstart
    • onmousedown
    • onmousemove
    • onmouseout
    • onmouseover
    • onmouseup
    • onmousewheel
    • onpause
    • onplay
    • onplaying
    • onprogress
    • onratechange
    • onreadystatechange
    • onscroll
    • onseeked
    • onseeking
    • onselect
    • onshow
    • onstalled
    • onsubmit
    • onsuspend
    • ontimeupdate
    • onvolumechange
    • onwaiting

    For a full explanation of these attributes, see HTML 5 event handler content attributes.

    Источник

Оцените статью