A: ARIA attributes must conform to valid names (WCAG 4.1.2)
aria-valid-attr
Ensure that attributes beginning with aria- are valid ARIA attributes from the specification.
This means
Non-existent or misspelled ARIA attributes are used, for example aria-lable, aria-describeby or made-up names like aria-foo. Such attributes are invalid because they are not defined in the ARIA specification.
Impact
Assistive technologies ignore invalid attributes. Name, role, value relationships break, cues are missing, and users receive unreliable information. This leads to misuse and a violation of the WCAG.
Recommendation
-
Only use attribute names defined in the ARIA specification (
aria-label,aria-labelledby,aria-describedby,aria-selectedetc.). -
Check spelling: all lowercase, spelled exactly.
-
Remove invalid or invented attributes.
-
Prefer native HTML elements and attributes where possible.
Example
Problematic
<button aria-lable="Search"></button>
<a href="#help" aria-describeby="help"></a>
<div role="tab" aria-selectedd="true">About us</div>
Better
<button aria-label="Search"></button>
<a href="#help" aria-describedby="help">Help</a>
<div role="tab" aria-selected="true">About us</div>
Related WCAG criterion:
WCAG 4.1.2 - Name, Role, Value