Rule
Valid ARIA values
aria attributes must exist and have valid values.
- Rule
aria-attr-valid- WCAG 2.2
- 4.1.2 Name, Role, Value (opens in a new tab) (Level A)
- Severity
- Critical
What it checks
Many ARIA attributes take a fixed set of values: aria-expanded takes true, false or undefined, and aria-live takes off, polite or assertive. The rule fails an element where one of these attributes has a value outside its set, such as aria-expanded="yes", on a role that supports the attribute. The browser cannot read the value, so the state the author wrote never reaches assistive technology.
The values of aria-current and aria-invalid are not judged, because ARIA treats an unknown value for either as true.
When a person decides
An attribute name that is not part of ARIA, such as a misspelt aria-lable, is sent for review, and so is an enumerated attribute left empty. The browser ignores both, so nothing is announced wrongly, but a state or name the author meant may be missing. A person needs to check what was intended.
Example
Fails
<button aria-expanded="yes" aria-controls="menu">Menu</button>
<ul id="menu">
<li><a href="/shop/">Shop</a></li>
</ul>
Passes
<button aria-expanded="true" aria-controls="menu">Menu</button>
<ul id="menu">
<li><a href="/shop/">Shop</a></li>
</ul>
The engine is tested against both examples.
How to fix it
Use one of the values the attribute allows, such as aria-expanded="true", and correct any misspelt attribute name against the WAI-ARIA specification.
Check your own pages
This rule runs in every pour audit: the browser extension, the bookmarklet, the command line and the editor. Get pour, free.