The <menuitem> tag defines a command/menu item that the user can invoke from a popup menu.
<menuitem> |
No | No | Yes | No | No |
The <menuitem> tag is new in HTML5.
Attribute | Value | Description |
---|---|---|
checked | checked | Mark to check that the menu item. Only for type="radio" or type="checkbox" |
command | string | Command |
default | default | Marks the menuitem as a default command |
disabled | disabled | Disable menu item |
icon | URL | Set an icon for the menu item |
label | text | Required. Set the label of the menuitem |
radiogroup | groupname | Mark the group name that will be toggled when the menu item is toggled. Only for type="radio" |
type | checkbox command radio |
Specifies the type of menu item. Default is "command" |
The <menuitem> tag supports the Global Attributes in HTML.
The <menuitem> tag supports the Event Attributes in HTML.
<!DOCTYPE html>
<html>
<body>
<!-- ww w . jav a2s .c o m-->
<div style="background:red;border:1px solid black;" contextmenu="mymenu">
<p>Right-click inside this box to see the context menu!
<menu type="context" id="mymenu">
<menuitem label="Refresh is added from menu"></menuitem>
</menu>
</div>
</body>
</html>