HTML <menuitem>-Tag
Beispiel
Enthält verschiedene <menuitem>-Elemente in einem Kontextmenü:
<menu type="context" id="mymenu"> <menuitem label="Aktualisieren" onclick="window.location.reload();" icon="ico_reload.png"> </menuitem> <menu label="Teilen auf..."> <menuitem label="Twitter" icon="ico_twitter.png" onclick="window.open('//twitter.com/intent/tweet?text='+window.location.href);"> </menuitem> <menuitem label="Facebook" icon="ico_facebook.png" onclick="window.open('//facebook.com/sharer/sharer.php?u='+window.location.href);"> </menuitem> </menu> <menuitem label="Diese Seite per E-Mail senden" onclick="window.location='mailto:?body='+window.location.href;"></menuitem> </menu>
Browser-Unterstützung
IE | Firefox | Chrome | Safari | Opera |
---|---|---|---|---|
Firefox 8.0 und höher unterstützen den <menuitem>-Tag.
Definition und Verwendung
Der <menuitem>-Tag definiert Befehle/Menuelemente, die vom Benutzer aus einem Popup-Menü aufgerufen werden können.
Unterschiede zwischen HTML 4.01 und HTML 5
Der <menuitem>-Tag ist ein neuer Tag in HTML5.
Eigenschaft
neu : Neue Eigenschaft in HTML5.
Eigenschaft | Wert | Beschreibung |
---|---|---|
geprüft | geprüft | 在页面加载后选择命令/菜单项。 Only applicable for type="radio" or type="checkbox". |
default | default | Sets the command/menu item as the default command. |
disabled | disabled | Specifies that the command/menu item should be disabled. |
icon | URL | Specifies the icon of the command/menu item. |
open | open | Defines whether details are visible. |
label | text | Required. Specifies the name of the command/menu item to be displayed to the user. |
radiogroup | groupname | Specifies the name of the command group, which will be toggled when the command/menu item itself is toggled. Only applicable for type="radio". |
type |
|
Specifies the type of command/menu item. The default is "command". |
Global Attributes
Support for <menuitem> Tag Global Attributes in HTML.
Event Attributes
Support for <menuitem> Tag Event Attributes in HTML.
Related Pages
HTML DOM Reference Manual:MenuItem Object