<menu>
The <menu> element represents an unordered list of commands or interactive options. In current HTML specifications, it behaves identically to <ul> - browsers render it the same way. While previous HTML5 drafts proposed toolbar and context menu functionality, these features were never implemented by browsers and have been removed from the specification.
This page was last updated on 2025-11-17
Syntax
<menu>
<li><button>Cut</button></li>
<li><button>Copy</button></li>
<li><button>Paste</button></li>
</menu>
The <menu> element is a block-level element that requires both opening and closing tags. It can contain <li> elements, scripts, and template elements.
Attributes
The <menu> element only supports global attributes:
- class - CSS class name for styling
- id - Unique identifier for the element
- style - Inline CSS styles
- title - Advisory information (tooltip)
- lang - Language of the content
Note: The type and label attributes that appeared in earlier HTML5 drafts are now obsolete. No browser ever implemented the toolbar or context menu functionality, so these attributes should not be used.
Examples
Simple Command List
<menu>
<li><button type="button">Bold</button></li>
<li><button type="button">Italic</button></li>
<li><button type="button">Underline</button></li>
</menu>
Editing Toolbar with ARIA
<div role="toolbar" aria-label="Text formatting">
<menu>
<li><button aria-pressed="false">B</button></li>
<li><button aria-pressed="false">I</button></li>
<li><button aria-pressed="false">U</button></li>
</menu>
</div>
Since <menu> doesn't provide toolbar semantics, you need to add ARIA attributes yourself for accessibility.
When to Use <menu>
Use <menu> for:
- Lists of interactive commands or controls
- Action buttons grouped together
- Application toolbars (with ARIA for accessibility)
Don't use <menu> for:
- Standard navigation menus - use
<nav>with<ul> - General content lists - use
<ul>or<ol> - Context menus - no browser supports this
Why Use <menu> Over <ul>?
Practically speaking, there's no functional difference - browsers treat them identically. However, <menu> provides semantic meaning that this is a list of commands rather than general content. This can be useful for:
- Code readability - clearly indicates interactive command lists
- Future-proofing - if browsers add special handling later
- Semantic accuracy - distinguishes commands from content lists
That said, <ul> is more widely used and understood, so the choice is largely stylistic.
History and Browser Support
The <menu> element has a complicated history:
- HTML 2.0 - 3.2 - Defined as alternative to
<ul>for menu lists - HTML 4.01 - Deprecated in favor of
<ul> - Early HTML5 drafts - Repurposed for toolbars and context menus with
typeattribute - Current HTML - Toolbar/context features removed (never implemented by browsers)
Today, <menu> is essentially synonymous with <ul>. All major browsers support it, but render it identically to an unordered list.