**`<menu>`** has an unusual history: earlier HTML specs positioned it as a distinct element for toolbars of commands or context menus, with a `type` attribute (`toolbar`, `context`, `list`) controlling its behavior. Current browsers render it essentially identically to `<ul>` and don't implement the old command-menu behaviors, so in practice today it's most often used, if at all, as a plain list container — semantically a near-synonym for `<ul>` — typically holding a set of `<li><button>` interactive commands.
1Understanding <menu>
`<menu>` has an unusual history: earlier HTML specs positioned it as a distinct element for toolbars of commands or context menus, with a type attribute (toolbar, context, list) controlling its behavior. Current browsers render it essentially identically to <ul> and don't implement the old command-menu behaviors, so in practice today it's most often used, if at all, as a plain list container — semantically a near-synonym for <ul> — typically holding a set of <li><button> interactive commands.
Because browser support for menu's special toolbar/context behaviors never solidified, most developers today just use <ul> for lists and rely on JavaScript UI libraries for actual context menus and toolbars.
<menu>
<li><button onclick="document.execCommand('bold')">Bold</button></li>
<li><button onclick="document.execCommand('italic')">Italic</button></li>
</menu>2Practical Example
Here is a real-world application of <menu> showing how it is used in production HTML.
<!-- Functionally, <menu> renders like <ul> in modern browsers -->
<menu>
<li>Item A</li>
<li>Item B</li>
</menu>3Best Practices
Follow these guidelines when working with <menu>:
1. Don't rely on <menu> for real native context-menu or toolbar behavior — browser support is inconsistent
2. Use <ul> instead for standard lists unless you have a specific reason to use <menu>
3. If using <menu>, treat it as you would <ul> — wrap actionable items in <li><button>
Tip: Because browser support for menu's special toolbar/context behaviors never solidified, most developers today just use <ul> for lists and rely on JavaScript UI libraries for actual context menus and toolbars.
<menu>
<li><button onclick="document.execCommand('bold')">Bold</button></li>
<li><button onclick="document.execCommand('italic')">Italic</button></li>
</menu>