Label points at an element that does not exist

  • WCAG 4.1.2 Name, Role, Value, level A
  • Serious
  • Structure
  • Automated
  • Server pass

Why it matters

aria-labelledby, aria-describedby and for can only work if the id they mention exists. A broken reference silently leaves the control without a name.

How to fix it

Fix the id so it matches an element on the page, or remove the attribute.

<!-- Before -->
<input aria-labelledby="nme">
<label id="name-label">Name</label>

<!-- After -->
<input aria-labelledby="name-label">
<label id="name-label">Name</label>

Read the W3C guidance: Understanding 4.1.2 Name, Role, Value.

Related rules

Find this on your own site. A11yMate scans every page and lists where it happens. See pricing or browse all rules.