<menuitem>

by 1 contributor:

This translation is incomplete. Please help translate this article from English.

これは実験段階の機能です。
この機能は複数のブラウザで開発中の状態にあります。各ブラウザで用いるために、適切なベンダー接頭辞が必要な場合があります。互換性テーブルをチェックしてください。また、実験段階の機能の構文と挙動は、仕様変更に伴い各ブラウザの将来のバージョンで変更になる可能性があることに注意してください。

概要

HTMLの menuitem 要素( <menuitem>) は、ユーザがポップアップメニュから実行できるコマンドをあらわします。This includes context menus, as well as menus that might be attached to a menu button.

A command can either be defined explicitly, with a textual label and optional icon to describe its appearance, or alternatively as an indirect command whose behavior is defined by a separate element. Commands can also optionally include a checkbox or be grouped to share radio buttons. (Menu items for indirect commands gain checkboxes or radio buttons when defined against elements <input type="checkbox"> and <input type="radio">.)

  • コンテンツカテゴリなし。
  • 許可された内容 なし。これは空要素です。
  • タグの省略開始タグが必須で、終了タグは不要です。
  • 許可された親要素 <menu> element, where that element is in the popup menu state. (If specified, the type attribute of the <menu> element must be popup; if missing, the parent element of the <menu> must itself be a <menu> in the popup menu state.)
  • DOM インターフェース HTMLMenuItemElement

属性

この要素はグローバル属性をサポートしています。特にtitle属性はコマンドの説明やヒントを出すのに使われます。

checked
コマンドが選択されているか否かを示す論理属性。type属性がcheckboxまたはradioのときのみ使われます。
command
Specifies the ID of a separate element, indicating a command to be invoked indirectly. May not be used within a menu item that also includes the attributes checked, disabled, icon, label, radiogroup or type.
default
This Boolean attribute indicates use of the same command as the menu's subject element (such as a button or input).
disabled
Boolean attribute which indicates that the command is not available in the current state. Note that disabled is distinct from hidden; the disabled attribute is appropriate in any context where a change in circumstances might render the command relevant.
icon
Image URL, used to provide a picture to represent the command.
label
The name of the command as shown to the user. Required when a command attribute is not present.
radiogroup
This attribute specifies the name of a group of commands to be toggled as radio buttons when selected. May only be used where the type attribute is radio.
type
This attribute indicates the kind of command, and can be one of three values.
  • command: A regular command with an associated action. This is the missing value default.
  • checkbox: Represents a command that can be toggled between two different states.
  • radio: Represent one selection from a group of commands that can be toggled as radio buttons.

Examples

<menuitem type="command" label="Save" icon="icons/save.png" onclick="save()">

Specifications

Specification Status Comment
WHATWG HTML Living Standard
The definition of '<menuitem>' in that specification.
Living Standard  
HTML5.1
The definition of '<menuitem>' in that specification.
草案  

Browser compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support ? 8 (8) ? ? ?
Feature Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support ? 8.0 (8) ? ? ?

See also

ドキュメントのタグと貢献者

Contributors to this page: yuji38kwmt
最終更新者: yuji38kwmt,