Rule

ARIA id references

ARIA id references must point to elements that exist.

Rule
aria-valid-refs
WCAG 2.2
4.1.2 Name, Role, Value (opens in a new tab) (Level A)
Severity
Moderate

What it checks

The rule follows every id in aria-labelledby, aria-describedby, aria-controls, aria-activedescendant, aria-owns, aria-details and, while the field is marked invalid, aria-errormessage. It fails a control, such as a button, link, form field or anything that takes focus, when its aria-labelledby points at nothing and leaves it without a name, or when its aria-activedescendant points at nothing, so a screen reader cannot tell which item is active.

A dead aria-labelledby passes when the element still has a name from elsewhere, such as its own text. An aria-controls on a control marked aria-expanded="false" is not judged, because the panel it opens is often created only when it opens.

When a person decides

Other broken references are sent for review. An aria-describedby that points at nothing may belong to a tooltip created on hover or focus, and a dead aria-labelledby on a landmark, list or group leaves unnamed something WCAG does not require to have a name. An id shared by several elements is sent for review too, because the reference binds to the first of them, which may not be the one intended.

Example

Fails

<button type="button" aria-labelledby="close-label">
  <span class="icon-close"></span>
</button>

Passes

<button type="button" aria-labelledby="close-label">
  <span class="icon-close"></span>
</button>
<span id="close-label" hidden>Close</span>

The engine is tested against both examples.

How to fix it

Give the target element the id the reference names, or correct the reference. If nothing should be referenced, remove the attribute.

Check your own pages

This rule runs in every pour audit: the browser extension, the bookmarklet, the command line and the editor. Get pour, free.