# \[aria-activedescendant\]

> The `aria-activedescendant` ARIA attribute identifies the currently active descendant of a composite widget.

## How does aria-activedescendant work in a listbox or combobox?

The attribute that specifies the ID of the currently active descendant element within a composite widget. It helps assistive technologies know which element within a group is currently focused or selected.

- Topic: Relationship Attributes
- Type: attribute

## Example

Wrong:

```html
<ul role="listbox" aria-activedescendant="opt2">
  <li id="opt1" role="option">Apple</li>
  <li id="opt2" role="option">Pear</li>
</ul>
```

Right:

```html
<ul role="listbox" tabindex="0" aria-label="Fruit" aria-activedescendant="opt2">
  <li id="opt1" role="option">Apple</li>
  <li id="opt2" role="option" class="active">Pear</li>
</ul>
```

The listbox can take focus and has a name, and the active option is styled, so the virtual focus is usable.

## Common mistakes

- Setting `aria-activedescendant` on a `<div>` without `tabindex`, so it never gets focus.
- Pointing at an ID that was removed after filtering, so nothing is announced.

## Key points

- DOM focus stays on the container or input, which is focusable and has a composite role.
- The referenced ID points to an existing descendant or owned element with a role like `option`.
- Arrow keys update `aria-activedescendant` and the active item is visually highlighted and scrolled into view.

## Interview questions

### aria-activedescendant vs roving tabindex: which is better?

Both work. Roving `tabindex` moves real focus and is widely supported. `aria-activedescendant` suits comboboxes where focus must stay in the input.

### Does aria-activedescendant fire focus events on the item?

No. The item never gets DOM focus, so `:focus` styles and focus events do not apply; style it with a class.

## Related cards

- [combobox](https://wonderium.dev/a11y/combobox.md)
- [listbox](https://wonderium.dev/a11y/listbox.md)
- [option](https://wonderium.dev/a11y/option.md)
- [\[tabindex\]](https://wonderium.dev/html/tabindex.md)
- [\[aria-owns\]](https://wonderium.dev/a11y/aria-owns.md)

---

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