Parsing
HTML needs to be well-formed enough — no duplicate IDs, no broken nesting — for assistive technology to parse it reliably.
What it means
This one has an asterisk: it existed in WCAG 2.0 and 2.1, but the working group retired it in WCAG 2.2 because modern browsers and screen readers have gotten good enough at recovering from messy HTML that the criterion stopped adding much value on its own. We still flag one specific piece of it, because it can cause real, concrete bugs: every id attribute on a page is supposed to be unique.
Why it matters
Plenty of things on a page rely on IDs pointing at exactly one element — a <label for="email"> is supposed to match exactly one input, an aria-labelledby is supposed to point at exactly one piece of text. When an ID is reused, the browser has to guess which element you meant, and it doesn't always guess the one you intended — so a label can end up describing the wrong field, or a screen reader can jump to the wrong place entirely.
What our scan checks for
- Any id attribute value that appears on more than one element on the page.
How to fix it
- Make sure every id on the page is unique — a quick search for the duplicated value in your page source will show you both places it's used.
- If you're generating markup from a template or component that's repeated on the page (a card, a modal), make sure it's generating a unique id per instance rather than a hardcoded one.
See where this shows up on your site
Run a free scan to check your pages against this and every other criterion we cover.
Scan a website free