IDs Used in ARIA and Labels Must Be Unique

No Comments

Quick Reference

Element Code: AC-012

Issue: Duplicate IDs are used for ARIA references or form labels

Impact: ARIA relationships and form labels may reference wrong elements

Fix: Ensure all IDs are unique across the page

Detection: axe DevTools, HTML validators, browser DevTools

What Is This Issue?

HTML IDs must be unique on a page. When ARIA attributes like aria-labelledby or aria-describedby reference an ID, or when a label's "for" attribute references an input's ID, duplicate IDs cause unpredictable behavior. The browser may associate elements with the wrong labels or descriptions.

Why This Matters

If two elements share the same ID and a label or ARIA attribute references that ID, there's no guarantee which element will be associated. This can result in:

  • Form labels pointing to wrong inputs
  • ARIA descriptions referencing wrong content
  • Screen readers announcing incorrect information

How to Fix This Issue

  1. Audit IDs: Search your HTML for duplicate IDs
  2. Rename Duplicates: Give each element a unique ID
  3. Update References: Fix any ARIA or label references to use correct IDs
  4. Use Generated IDs: For dynamic content, generate unique IDs programmatically

TL;DR (The Simple Version)

You have duplicate IDs on your page, and those IDs are used for labels or ARIA attributes. This means labels might connect to the wrong form fields. Make sure every ID on your page is unique.

About SEO ProCheck

Technical SEO consulting and GEO strategy with 20 years of enterprise experience. Case studies, resources, and tools for search and AI visibility.

Work With Me

Technical SEO audits, GEO strategy, site migrations, and international SEO. Hourly consulting for teams who need hands-on support, not just reports.

Subscribe to our newsletter!

More from our blog