Skip to content

HTML <menuitem> Tag

The HTML <menuitem> tag defines a command or menu item that users can invoke from a popup menu defined with the <menu> tag. This includes context menus and menus that can be attached to a menu button.

Note: The <menuitem> tag is obsolete and unsupported in modern browsers. It was removed from the HTML Living Standard and should not be used in new projects.

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 of the HTML <menuitem> tag:

HTML <menuitem> Tag

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

Result

menuitem example

Attributes

AttributeValueDescription
checkedcheckedDefines that the command / menu item must be checked when the page is being loaded (used only for type = "radio" and type = "checkbox").
defaultdefaultMarks command/menu item as a default command.
disableddisabledDefines that the command/menu item must be disabled.
iconiconDefines an icon for the menu /command item.
labeltextDefines that the command / menu item will be displayed for the user. The attribute is required.
radiogroupgroupnameDefines the name of grouped commands, which will be toggled when command/menu item is toggled. Used only for type = "radio".
typecheckbox, command, radioDefines the type of command/menu item. The default value is command.

Note: All attributes are obsolete and unsupported in modern browsers.

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

How to style an HTML <menuitem> Tag

Due to the tag's obsolete status, it is not rendered as a functional menu item in modern browsers. Standard CSS properties like display, margin, and padding will not restore its intended functionality.

Practice

What is true about the HTML <menuitem> tag?

Dual-run preview — compare with live Symfony routes.