# option

> The `option` ARIA role is used for an item within a listbox, combobox or other selection container.

## What is role='option' and where can it be used?

The role used to represent an individual item within a selectable list or menu. It helps users identify choices available within a larger set of options.

- Topic: Basic Control Elements
- Type: role

## Example

Wrong:

```html
<div role="listbox" aria-label="Size">
  <div class="selected">S</div>
  <div>M</div>
</div>
```

Right:

```html
<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 a `listbox` or a `group` within one.
- Selectable options have `aria-selected` that 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>`.

## Related cards

- [listbox](https://wonderium.dev/a11y/listbox.md)
- [combobox](https://wonderium.dev/a11y/combobox.md)
- [\[aria-selected\]](https://wonderium.dev/a11y/aria-selected.md)
- [`<option>`](https://wonderium.dev/html/option.md)
- [\[aria-setsize\]](https://wonderium.dev/a11y/aria-setsize.md)

---

- Level: [Accessibility](https://wonderium.dev/a11y.md)
- HTML version: https://wonderium.dev/a11y/option
- Last updated: 2026-11-25
