HTML <menuitem> Tag

The <menuitem> tag contains commands/items, which could be invoked from a popup menu, defined with the <menu> tag.

Syntax

The <menuitem> tag comes in pairs; the content is written between the opening (<menuitem>) and closing (</menuitem>) tags. The <menuitem> tag is nested inside the <menu> element.

Example

<!DOCTYPE html>
<html>
  <head>
    <title>Title of the document</title>
    <style>
      menuitem {
        display: block;
      }
    </style>
  </head>
  <body>
    <menu>
      <menuitem>ol – ordered list</menuitem>
      <menuitem>ul – unordered list</menuitem>
      <menuitem>menu – menu</menuitem>
    </menu>
  </body>
</html>

Result

Attributes

Attribute Value Description
checked checked Defines that the command / menu item must be checked when the page is being loaded (used only for type = "radio" and type = "checkbox").
default default Marks command/menu item as a default command.
disabled disabled Defines, that the command/menu item must be disabled.
icon icon Defines an icon for the menu /command item.
label text Defines that the command / menu item will be displayed for the user. The attribute is required.
radiogroup groupname Defines the name of grouped commands, which will be toggled when commend/menu item is toggled. Used only for type = "radio".
type checkbox
command
radio
Defines the type of command/menu item. The default value is command.

The <menuitem> tag supports the Global Attributes and the Event Attributes.

Browser support

8+