Skip to content
Tutorials Center
My learning

Topics

HTML Reference ยท Text Content

The <menu> element

Reference for the HTML <menu> element: an unordered list of commands such as toolbar buttons, how it differs from <ul> and <nav>, and technical details.

The <menu> element is an unordered list of commands: the items a user can act on, such as the buttons in a toolbar or the actions for a selected message. In the browser it behaves exactly like a <ul>: it contains <li> elements and shows bullets by default. The difference is purely semantic.

HTML
<menu>
  <li><button type="button">Reply</button></li>
  <li><button type="button">Archive</button></li>
</menu>

Try it

A text editor toolbar

Attributes

This element has no attributes of its own. It accepts the global attributes. The old type and label attributes for context menus were never widely supported and are no longer part of HTML.

Usage notes

  • Commands, not links. Use <menu> for a set of actions (usually buttons). A list of links that move around the site belongs in a <ul> inside a <nav>.
  • Not an ARIA menu. <menu> is exposed as a plain list. It does not give you the keyboard behavior of a desktop-style menu widget; building that requires role="menu", menuitem roles and your own script.
  • Same rendering as <ul>. Expect bullets and left padding by default; most toolbars reset them with list-style: none and padding: 0.
  • History. Older drafts of HTML had a richer <menu> for context menus and <menuitem>. Those features were removed; today's <menu> is just a semantic list.

Technical summary

Content categories Flow content; palpable content if it has at least one <li> child
Permitted content Zero or more <li> elements and script-supporting elements
Tag omission None; both the start and end tags are required
Permitted parents Any element that accepts flow content
Implicit ARIA role list
DOM interface HTMLMenuElement
Default display block

Browser support

Supported in every browser as a list. The removed context-menu features are not supported anywhere.