Dieser Inhalt ist derzeit nur auf Englisch verfügbar
Audit duplicate-id-aria
Ensure every id attribute value used in ARIA and in labels is unique
Impact:
Critical
WCAG-Konformität:
A
WCAG 4.1.2
Issue type:
needs review
Id attribute value is unique
This rule checks that all `id` attribute values on a single page are unique.
Content loading...
Autoren: Anne Thyme Nørregaard, Bryn Anderson
Finanzierung: WAI-Tools
Applicability
This rule applies to any id attribute whose value is not an empty string (""), specified on a HTML or SVG element.
Note: Elements that are neither included in the accessibility tree nor visible are still considered for this rule.
Expectation
The value of the attribute is unique across all other id attributes specified on HTML or SVG elements that exist within the same document tree or shadow tree as the element on which the applicable id attribute is specified.
There is only one id attribute within the document context.
<divid="my-div">This is my first element</div>
Passed Example 2
All id attributes are unique within the document context.
<divid="my-div1">This is my first element</div><divid="my-div2">This is my second element</div><svgid="my-div3">This is my third element</svg>
Passed Example 3
Two of the id attributes are the same (my-elt), but they are in different trees (the first one in the document tree and the second in the shadow tree).
The id attribute label is not unique among all id attributes in the document, resulting in a wrong programmatic label on the input field. This rule still considers elements that are neither included in the accessibility tree nor visible.