The <menuitem> element once represented a single command inside a <menu> — mainly for experimental HTML5 context menus. That design was never widely shipped.
Learn it only to recognize legacy docs. For new work, put <button> (or links) inside <li> within <menu>. Custom right-click menus need script that listens for the contextmenu event (HTML Standard guidance).
Obsolete.
Do not use <menuitem>. It is listed as non-conforming in the HTML Standard and removed from practical browser support.
Not a Baseline feature.
Unlike <menu>, <menuitem> has no modern implementation path. Treat it as archive knowledge only.
Syntax
HTML Syntax
syntax.html
<!-- Obsolete — do not use -->
<menuitem label="Save" type="command">
Modern equivalent:<menu><li><button type="button">Save</button></li></menu>
Reference
Attributes
Legacy attributes (study only). None of these make menuitem valid today.
Toggle hidden and mirror state with aria-expanded.
For right-click menus, listen for contextmenu in script — do not use menuitem.
Edge Cases & Pitfalls
The main risk is copying obsolete HTML5 menu samples into new projects.
obsolete
Do not use in new HTML
Validators reject <menuitem>. Rewrite to buttons inside menu/li.
contextmenu
No declarative HTML context menus
The old menu type="context" + menuitem path is gone. Use the contextmenu event + your own UI.
confusion
menu is not obsolete
<menu> remains valid. Only <menuitem> (and the context-menu feature) are obsolete.
aria
ARIA role="menuitem" is different
The ARIA role name is unrelated permission to use the obsolete HTML element. Prefer native buttons when you can.
migration
Replace labels with button text
Old label="Save" becomes <button>Save</button> (visible text, not an attribute-only name).
Compatibility
Browser Support
<menuitem> is an obsolete HTML element. Prefer <button> inside <menu> / <li>.
✓ Obsolete · Not supported
<menuitem>
Removed from the HTML Standard for authors. No reliable modern browser support for the old context-menu design.
0%Practical support (approx.)
Google ChromeRemoved / unused
Obsolete
Mozilla FirefoxRemoved / unused
Obsolete
Apple SafariNot supported
Obsolete
Microsoft EdgeRemoved / unused
Obsolete
OperaRemoved / unused
Obsolete
Samsung InternetNot supported
Obsolete
Internet ExplorerN/A
Obsolete
<menuitem>Do not use
Bottom line: Do not depend on menuitem. Ship buttons in a menu list, or build a custom scripted menu.
Remember
Key Takeaways
Status:<menuitem> is obsolete — study it, do not ship it.
Replacement:menu → li → button.
Context menus: use the contextmenu event + your own UI.
Keep menu: the <menu> element itself is still valid.
One line: recognize <menuitem>, replace it with <button> in a <menu>.
UA style
Default CSS Settings
There is no meaningful modern UA stylesheet for menuitem. Prefer styling real controls:
default.css
/* Do not style menuitem for new work */
menu {
list-style: none;
padding: 0;
}
menu button {
/* your toolbar button styles */
}
Delete any CSS selectors targeting menuitem when you migrate legacy pages.
Frequently Asked Questions
No. The menuitem element is entirely obsolete. Authors must not use it. Modern browsers do not implement it as a working menu command.
It once represented a command inside a menu — especially experimental HTML5 context menus. That feature was removed from the HTML Standard.
For toolbars, use menu with li and button (or links). For custom context menus, handle the contextmenu event in script and build an accessible menu UI yourself.
Not as a useful widget. Support was never broad; remaining engines ignore or strip the feature. Treat any old markup as dead code.
menu remains valid as a list of commands. menuitem does not. Put buttons inside li children of menu instead.
Legacy drafts used label for the visible name and type for command, checkbox, or radio items. Those attributes are historical only — do not ship them on menuitem.