<menu>: The MENU Element

Last updated: 2026-10-13

<menu>The MENU Element

Represents a list of commands or menu items, often a toolbar or context menu; may contain <li> or <button> elements.

CategoryForms
Content ModelFlow content
Allowed ParentsAny element that accepts flow content
Content TagYes — requires closing </menu> tag
StatusStandard

📝 Syntax

<menu>
  <li><button>Copy</button></li>
  <li><button>Paste</button></li>
</menu>

⚙️ Attributes

This element supports the global attributes plus the following:

AttributeValueDescription
typeMenu type: toolbar (default) or context.
labelA human-readable label, often for context menus.

▶ Example

Edit the code below and see the live result in the playground:

🌐 Browser Support

Browser ChromeChrome EdgeEdge FirefoxFirefox SafariSafari OperaOpera
<menu> ✓ v1 ✓ v12 ✓ v1 ✓ v1 ✓ v1
Supported in all major browsers
Tip: menu is like <ul> but means a command list; rendering support varies—use <ul> for simple lists.

❓ FAQ

QWhat is the difference between menu and nav?
ATheir semantics are close and historically tangled: HTML5 finally defines <menu> as a toolbar/command menu, semantically equivalent to <ul>. Site navigation belongs to <nav>; in-app toolbars and command lists may use <menu>. In practice, menu usage is very low.
QCan menu build a right-click context menu?
AIt used to — the old spec had the contextmenu attribute plus the menu/menuitem combo — but that design was abandoned entirely and no mainstream browser shipped it. Custom context menus today are JS + custom DOM only.
QHow do I write items inside menu?
ASame as <ul>: children are <li>, and in a command menu each li holds a <button> — the best choice, natively focusable and keyboard-operable. Add role and aria-label on the container for better accessibility.
More case studies coming soon — check back later.

📚 Related Tutorials

Web-Tutorial.com

Web-Tutorial Tech Team

A team of developers maintaining programming tutorials. Each tutorial is written and reviewed by developers with expertise in that field. We work to keep our content accurate and reliable — if you spot an issue, please let us know.

100%

🙏 帮我们做得更好

我们是刚上线的编程教程站,几个人的小团队,精力有限。页面虽经检查,难免还有疏漏——链接失效、排版错乱、内容有误、语言生硬……

如果您发现了,麻烦告诉我们,我们会在收到反馈后第一时间进行修复,再次感谢您的光临 🙏