IDs used in ARIA and labels must be unique

Rule ID: duplicate-id-aria
Ruleset: axe-core 4.12
User Impact: Critical
Guidelines: WCAG 2.1 (A), WCAG 2.0 (A), WCAG 2.2 (A), EN 301 549, RGAA

Start building more accessible experiences

Axe DevTools Pro helps development teams find and fix up to 80% of accessibility issues while coding. No experience required. Get started with your free trial today.

Compliance Data & Impact

User Impact

Disabilities Affected

  • Blind
  • Deafblind

Standard(s)

  • WCAG 2.1 (A)
  • WCAG 2.0 (A)
  • WCAG 2.2 (A)
  • EN 301 549
  • RGAA

WCAG Success Criteria [WCAG 2.1 (A)]

  • 4.1.2: MUST: Name, Role, Value

WCAG Success Criteria [WCAG 2.0 (A)]

  • 4.1.2: MUST: Name, Role, Value

WCAG Success Criteria [WCAG 2.2 (A)]

  • 4.1.2: MUST: Name, Role, Value

EN 301 549 Guidelines

  • 9.4.1.2: MUST: Name, Role, Value

    How to Fix the Problem

    Rename any duplicate id values in the document so each referenced element has a unique id.

    Why it Matters

    Duplicate IDs are common validation errors that may break the accessibility of labels, e.g., ARIA elements, form fields, table header cells.

    Unique ID's differentiate each element from another and prevent invalid markup, wherein only the first instance gets acted upon by client-side scripting, or where assistive technologies typically only reference the first one accurately.

    Rule Description

    When an element's id is referenced by an ARIA attribute or by a <label>'s for attribute, that id must be unique in the document. If more than one element shares the same id, assistive technology will typically only resolve the reference to the first one and overlook the others.

    Note: it is fine for multiple references to point at the same id (for example, two <label for="name"> elements associated with a single <input id="name">). It is only a problem when two or more elements share the same id.

    The Algorithm (in simple terms)

    Ensures every id referenced by an ARIA attribute or a <label>'s for attribute is unique in the document.

    Resources

    Other Resources

    You may also want to check out these other resources.

    Refer to the complete list of axe 4.12 rules.

    Was this information helpful?

    You have already given your feedback, thank you..

    Your response was as follows:

    Was this information helpful?
    Date/Time feedback was submitted: