• Success Criterion 4.1.2
  • Conformance level A

Duplicate Element IDs Causing a Control’s Name to Resolve Wrong

4.1.2 — Name, Role, Value

Scenario

Setting

A childcare-booking service's scheduling page

What’s wrong

Duplicate IDs making aria-labelledby (code pointing to the element that names it)/for resolve to the wrong node (name wrong).

Example

<div class="checkbox" onclick="toggle()"></div>

Why it matters

Screen-reader and voice-control users who can operate only what the accessibility tree exposes.

How to test

Inspect for/id and aria-labelledby references in DevTools: if duplicate ids exist on the page, the browser may resolve a name to the wrong element.

How to fix

Make ids unique so names resolve to the intended elements.

<input type="checkbox" id="opt-1">
<label for="opt-1">Email notifications</label>

A native input exposes its role and checked state automatically; a styled div exposes none of that without a lot of manual ARIA.

Outcome

On a childcare-booking service's scheduling page, this barrier is gone for screen-reader and voice-control users who can operate only what the accessibility tree exposes — they can finish what they came here to do.

Who is affected

Screen-reader and voice-control users who can operate only what the accessibility tree exposes.

Learn more