htmlaccessibilitywai-aria

What is the difference between the menuitemradio and radio roles in ARIA?


I have just learnt about menuitemradio when I was searching about radio role on MDN.

However, seems there is no explanation about the difference between them..

Can I confirm that they are actually the same, but:

Are these correct?


Additionally, so that:


Solution

  • The roles menuitemradio and radio are not the same.

    The radio role is the role that HTML's native radio buttons have (<input type="radio">). This is a role for custom radio buttons, which should be grouped in an element with the radiogroup role.

    The menuitemradio role is not an alternative to the above; it does not represent a radio button. It is a kind of option in a set of options in a menu, where only one of those options can be selected at any time. An example is the setting for the bookmarks toolbar in Firefox:

    View menu in Firefox, with the following options for the bookmarks toolbar: Always Show, Only Show on New Tab, Never Show

    Elements with this role can only be used inside element with the following roles: menu, menubar or (if no other role accurate describes the container role) group.

    Radio buttons or custom element with the radio role should not be used in menus.