option
Example
<div role="listbox" aria-label="Size">
<div class="selected">S</div>
<div>M</div>
</div><div role="listbox" aria-label="Size">
<div role="option" aria-selected="true">S</div>
<div role="option" aria-selected="false">M</div>
</div>Each item is exposed as an option with its selection state, so screen readers read 'S, selected, 1 of 2'.
Common mistakes
- Using
role='option'on items outside any listbox, so screen readers ignore the context.
Key points
- Each
role='option'is inside alistboxor agroupwithin one. - Selectable options have
aria-selectedthat matches the visual selection. - Options contain only text or images, never buttons, links or inputs.
Interview questions
Does the HTML option element have the option role?
Yes. <option> inside <select> or <datalist> maps to option automatically.
How do I group options in a listbox?
Wrap them in an element with role='group' and an accessible name, like <optgroup label> does in a <select>.