HTML <menu> Element
The HTML <menu> element represents an unordered list of items and can be used to group related commands or controls.
Syntax
<menu>
<li>Menu item</li>
<li>Menu item</li>
</menu>
The <menu> element requires both an opening and closing tag. Its items are typically represented by <li> elements.
Attributes
The <menu> element supports the global HTML attributes. It does not have any element-specific attributes.
Example
This example uses a <menu> element to group several buttons that provide related editing commands.
Usage Notes
The <menu> element has the same basic content model as the <ul> element, but it can be used when the list represents a group of commands or controls rather than a general list of items.
For an ordinary unordered list of information, <ul> is usually the more appropriate element. A <menu> is useful when the grouped items represent actions the user can perform.
The <menu> element does not automatically create a toolbar, dropdown menu, or interactive navigation system. Any visual layout or styling needed for the menu must be provided with CSS.
Accessibility
Use meaningful text for controls placed inside a <menu> so users can understand what each action does. Native controls such as <button> should be used for actions whenever possible because they provide built-in keyboard and accessibility behavior.
Do not rely only on icons, colors, or visual placement to explain the purpose of a command. If an icon is used without visible text, provide an accessible name that clearly identifies the action.
Browser Support
Baseline: Widely available indicates a feature has been supported by core browsers for at least 30 months. At this stage, the feature is considered stable and safe for most websites to use without needing to worry about compatibility issues or fallbacks, as it is supported by the vast majority of users' devices and browser versions.
For detailed browser compatibility information, see Can I Use: HTML <menu> Element .
Related Elements
The <menu> element is closely related to the <ul> element for unordered lists, the <li> element for individual list items, and the <button> element for interactive commands.
