Semantics

An option in a set of choices contained by a menu or menubar.

Additional info from the ARIA specification

Authors MUST ensure elements with role menuitem are accessibility children of an element with role menu, menubar, or an element with role group that is an accessibility child of an element with role menu or menubar.

Authors MAY disable a menu item with the aria-disabled attribute. If the menu item has its aria-haspopup attribute set to true, it indicates that the menu item can be used to launch a sub-level menu, and authors SHOULD display a new sub-level menu when the menu item is activated.

In order to identify that they are related widgets, authors MUST ensure that menu items are accessibility descendants of an element with role menu or menubar. Authors MAY separate menu items into sets by use of a separator or an element with an equivalent role from the native markup language.

Abstract Role

  • WidgetRepresents a focusable, interactive element.

Content Category

Only Used with Specific Parent Roles

This role must be a direct descendant of one of the following roles:

  • menu
  • menubar
  • group

Allowed Descendants

Phrasing Children Allowed

No interactive content descendants, and no descendants with a tabindex attribute specified.

Note

Children Become Presentational

Browsers automatically apply the presentation role to all descendant elements, so their semantics are not conveyed to assistive technologies.

Usage

Allowed HTML elements

Implicit semantics

  • None

Explicitly allowed

  • a­[href][role=menuitem]
  • button[role=menuitem]
  • img[role=menuitem]

Elements that can have any role

  • abbr[role=menuitem]
  • address[role=menuitem]
  • b[role=menuitem]
  • blockquote[role=menuitem]
  • canvas[role=menuitem]
  • cite[role=menuitem]
  • code[role=menuitem]
  • custom-element[role=menuitem]
  • data[role=menuitem]
  • del[role=menuitem]
  • dfn[role=menuitem]
  • div[role=menuitem]
  • em[role=menuitem]
  • figure[role=menuitem]
  • i[role=menuitem]
  • ins[role=menuitem]
  • kbd[role=menuitem]
  • mark[role=menuitem]
  • output[role=menuitem]
  • p[role=menuitem]
  • pre[role=menuitem]
  • q[role=menuitem]
  • samp[role=menuitem]
  • small[role=menuitem]
  • span[role=menuitem]
  • table[role=menuitem]
  • tbody[role=menuitem]
  • tfoot[role=menuitem]
  • thead[role=menuitem]
  • time[role=menuitem]
  • u[role=menuitem]
  • var[role=menuitem]