Nossos voluntários ainda não traduziram este artigo para o Português (do Brasil). Junte-se a nós e ajude-nos a fazer o trabalho!
Você também pode ler o artigo em English (US).

Deprecated
This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

The HTML <menuitem> element represents a command that a user is able to invoke through a popup menu. This includes context menus, as well as menus that might be attached to a menu button.

A command can either be defined explicitly, with a textual label and optional icon to describe its appearance, or alternatively as an indirect command whose behavior is defined by a separate element. Commands can also optionally include a checkbox or be grouped to share radio buttons. (Menu items for indirect commands gain checkboxes or radio buttons when defined against elements <input type="checkbox"> and <input type="radio">.)

Content categories None.
Permitted content None, it is an empty element.
Tag omission Must have a start tag and must not have an end tag.
Permitted parents The <menu> element, where that element is in the popup menu state. (If specified, the type attribute of the <menu> element must be popup; if missing, the parent element of the <menu> must itself be a <menu> in the popup menu state.)
Permitted ARIA roles None
DOM interface HTMLMenuItemElement

Attributes

This element includes the global attributes; in particular title can be used to describe the command, or provide usage hints.

checked
Boolean attribute which indicates whether the command is selected. May only be used when the type attribute is checkbox or radio.
command
Specifies the ID of a separate element, indicating a command to be invoked indirectly. May not be used within a menu item that also includes the attributes checked, disabled, icon, label, radiogroup or type.
default
This Boolean attribute indicates use of the same command as the menu's subject element (such as a button or input).
disabled
Boolean attribute which indicates that the command is not available in the current state. Note that disabled is distinct from hidden; the disabled attribute is appropriate in any context where a change in circumstances might render the command relevant.
icon
Image URL, used to provide a picture to represent the command.
label
The name of the command as shown to the user. Required when a command attribute is not present.
radiogroup
This attribute specifies the name of a group of commands to be toggled as radio buttons when selected. May only be used where the type attribute is radio.
type
This attribute indicates the kind of command, and can be one of three values.
  • command: A regular command with an associated action. This is the missing value default.
  • checkbox: Represents a command that can be toggled between two different states.
  • radio: Represent one selection from a group of commands that can be toggled as radio buttons.

Example

HTML content

<!-- A <div> element with a context menu -->
<div contextmenu="popup-menu">
  Right-click to see the adjusted context menu
</div>

<menu type="context" id="popup-menu">
  <menuitem type="checkbox" checked>Checkbox</menuitem>
  <hr>
  <menuitem type="command" label="This command does nothing" icon="https://developer.cdn.mozilla.net/static/img/favicon144.png">
    Commands don't render their contents.
  </menuitem>
  <menuitem type="command" label="This command has javascript" onclick="alert('command clicked')">
    Commands don't render their contents.
  </menuitem>
  <hr>
  <menuitem type="radio" radiogroup="group1">Radio Button 1</menuitem>
  <menuitem type="radio" radiogroup="group1">Radio Button 2</menuitem>
</menu>

CSS content

div {
  width: 300px;
  height: 80px;
  background-color: lightgreen;
}

Result

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
Basic support
DeprecatedNon-standard
Chrome No support NoEdge Full support YesFirefox Full support 8
Notes
Full support 8
Notes
Notes Only works for <menuitem> elements defined within a <menu> element assigned to an element via the contextmenu attribute.
Notes The <menuitem> element requires a closing tag.
IE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoEdge Mobile Full support YesFirefox Android Full support 8
Notes
Full support 8
Notes
Notes Only works for <menuitem> elements defined within a <menu> element assigned to an element via the contextmenu attribute.
Notes The <menuitem> element requires a closing tag.
Opera Android No support NoSafari iOS No support NoSamsung Internet Android No support No
checked
DeprecatedNon-standard
Chrome No support NoEdge Full support YesFirefox Full support 8
Notes
Full support 8
Notes
Notes Only works for <menuitem> elements defined within a <menu> element assigned to an element via the contextmenu attribute.
Notes The <menuitem> element requires a closing tag.
IE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoEdge Mobile Full support YesFirefox Android Full support 8
Notes
Full support 8
Notes
Notes Only works for <menuitem> elements defined within a <menu> element assigned to an element via the contextmenu attribute.
Notes The <menuitem> element requires a closing tag.
Opera Android No support NoSafari iOS No support NoSamsung Internet Android No support No
command
DeprecatedNon-standard
Chrome No support NoEdge Full support YesFirefox Full support 8
Notes
Full support 8
Notes
Notes Only works for <menuitem> elements defined within a <menu> element assigned to an element via the contextmenu attribute.
Notes The <menuitem> element requires a closing tag.
IE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoEdge Mobile Full support YesFirefox Android Full support 8
Notes
Full support 8
Notes
Notes Only works for <menuitem> elements defined within a <menu> element assigned to an element via the contextmenu attribute.
Notes The <menuitem> element requires a closing tag.
Opera Android No support NoSafari iOS No support NoSamsung Internet Android No support No
default
DeprecatedNon-standard
Chrome No support NoEdge Full support YesFirefox Full support 8
Notes
Full support 8
Notes
Notes Only works for <menuitem> elements defined within a <menu> element assigned to an element via the contextmenu attribute.
Notes The <menuitem> element requires a closing tag.
IE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoEdge Mobile Full support YesFirefox Android Full support 8
Notes
Full support 8
Notes
Notes Only works for <menuitem> elements defined within a <menu> element assigned to an element via the contextmenu attribute.
Notes The <menuitem> element requires a closing tag.
Opera Android No support NoSafari iOS No support NoSamsung Internet Android No support No
disabled
DeprecatedNon-standard
Chrome No support NoEdge Full support YesFirefox Full support 8
Notes
Full support 8
Notes
Notes Only works for <menuitem> elements defined within a <menu> element assigned to an element via the contextmenu attribute.
Notes The <menuitem> element requires a closing tag.
IE No support NoOpera Full support Yes
Disabled
Full support Yes
Disabled
Disabled This feature is behind the Enable Experimental Web Platform Features preference (needs to be set to true).
Safari No support NoWebView Android No support NoChrome Android No support NoEdge Mobile Full support YesFirefox Android Full support 8
Notes
Full support 8
Notes
Notes Only works for <menuitem> elements defined within a <menu> element assigned to an element via the contextmenu attribute.
Notes The <menuitem> element requires a closing tag.
Opera Android No support NoSafari iOS No support NoSamsung Internet Android No support No
icon
DeprecatedNon-standard
Chrome No support NoEdge Full support YesFirefox Full support 8
Notes
Full support 8
Notes
Notes Only works for <menuitem> elements defined within a <menu> element assigned to an element via the contextmenu attribute.
Notes The <menuitem> element requires a closing tag.
IE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoEdge Mobile Full support YesFirefox Android Full support 8
Notes
Full support 8
Notes
Notes Only works for <menuitem> elements defined within a <menu> element assigned to an element via the contextmenu attribute.
Notes The <menuitem> element requires a closing tag.
Opera Android No support NoSafari iOS No support NoSamsung Internet Android No support No
radiogroup
DeprecatedNon-standard
Chrome No support NoEdge Full support YesFirefox Full support 8
Notes
Full support 8
Notes
Notes Only works for <menuitem> elements defined within a <menu> element assigned to an element via the contextmenu attribute.
Notes The <menuitem> element requires a closing tag.
IE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoEdge Mobile Full support YesFirefox Android Full support 8
Notes
Full support 8
Notes
Notes Only works for <menuitem> elements defined within a <menu> element assigned to an element via the contextmenu attribute.
Notes The <menuitem> element requires a closing tag.
Opera Android No support NoSafari iOS No support NoSamsung Internet Android No support No
type
DeprecatedNon-standard
Chrome No support NoEdge Full support YesFirefox Full support 8
Notes
Full support 8
Notes
Notes Only works for <menuitem> elements defined within a <menu> element assigned to an element via the contextmenu attribute.
Notes The <menuitem> element requires a closing tag.
IE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoEdge Mobile Full support YesFirefox Android Full support 8
Notes
Full support 8
Notes
Notes Only works for <menuitem> elements defined within a <menu> element assigned to an element via the contextmenu attribute.
Notes The <menuitem> element requires a closing tag.
Opera Android No support NoSafari iOS No support NoSamsung Internet Android No support No

Legend

Full support  
Full support
No support  
No support
Non-standard. Expect poor cross-browser support.
Non-standard. Expect poor cross-browser support.
Deprecated. Not for use in new websites.
Deprecated. Not for use in new websites.
See implementation notes.
See implementation notes.
User must explicitly enable this feature.
User must explicitly enable this feature.

See also