MDN self-hosted library · e01.org

ARIA: menuitemradio role

Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.

html
<div role="menuitemradio"><h6>Name of my radio button</h6></div>
html
<div role="menuitemradio">
  <h6 role="presentation">Name of my radio button</h6>
</div>
html
<div role="menuitemradio">Name of my radio button</div>
html
<li role="menuitemradio" tabindex="-1" aria-checked="false">Purple</li>
css
[role="menuitemradio"]::before {
  display: inline-block;
  content: "";
  width: 1em;
  height: 1em;
  padding: 0.1em;
  border: 2px solid #333333;
  border-radius: 50%;
  box-sizing: border-box;
  background-clip: content-box;
  margin-inline-end: 2px;
}
[role="menuitemradio"][aria-checked="true"]::before {
  background-color: purple;
}