Start scanning free

( Robust / WCAG 4.1.1 )

Duplicate id on active, focusable elements

This check maps to Parsing. Use the guidance below to confirm the issue, understand who it affects and ship a fix.

Serious Level A WCAG 4.1.1 — Parsing

What’s wrong

Two or more focusable, interactive elements, like buttons, links, or form fields, share the same id attribute.

Why it matters

IDs are meant to be unique. When two focusable elements share one, label[for], aria-labelledby, and in-page anchors can point at the wrong element, and browsers only reliably act on the first match.

How to fix it

Give every focusable element a unique id. If the markup is generated in a loop, append the item’s key or index.

Before
<button id="submit-btn">Save</button>
<a id="submit-btn" href="/cancel">Cancel</a>
After
<button id="save-btn">Save</button>
<a id="cancel-link" href="/cancel">Cancel</a>

Learn more