ARIA Attribute Value Validity
Rule ID: aria-valid-attr-value
Ruleset: axe-core 4.10
User Impact: Critical
Guidelines: WCAG 2.1 (A), WCAG 2.0 (A), WCAG 2.2 (A), EN 301 549
How to Fix the Problem
Ensure that each ARIA attribute (attributes beginning with aria-
) is assigned a value that is valid according to the WAI-ARIA specification.
Examples:
-
✅ Correct:
<div aria-hidden="true">
-
❌ Incorrect:
<div aria-hidden="rtue">
-
❌ Incorrect:
<div aria-hidden="pizza">
For roles such as checkbox
, allowed values for aria-checked
are only:
-
true
-
false
-
mixed
Using any value outside these results in a failure of functionality and accessibility.
Guidelines to Follow:
-
Spelling matters. Values must be exactly as specified (e.g., “true”, not “TRUE” or “tru”).
-
Use appropriate value types. Each ARIA attribute supports one or more of the following value types:
-
true/false
(e.g.,aria-hidden="false"
) -
tristate
(e.g.,aria-checked="mixed"
) -
true/false/undefined
-
ID reference
(e.g.,aria-labelledby="section1"
) -
ID reference list
-
integer
-
number
-
string
-
token
-
token list
-
Check the official WAI-ARIA 1.1 specification for a full list of valid attributes and their expected values.
Additional Considerations:
-
Undefined values: Some states or properties allow
"undefined"
as a valid option to indicate that the property is not set. -
Default vs. Implicit values: Certain roles change the default values of ARIA properties. Be aware of role-based expectations.
Why it Matters
ARIA attributes enable assistive technologies (AT), like screen readers, to interpret and interact with dynamic content. If these attributes contain invalid values:
-
AT cannot properly interpret them.
-
Users relying on assistive technologies may not receive accurate or actionable information.
-
The interactive components may become non-functional or misleading.
Correct ARIA usage ensures a seamless, inclusive, and accessible user experience.
Rule Description
ARIA attributes must include only valid, semantically correct values. Each attribute has a defined set of acceptable values, and deviations—even small spelling mistakes—can render the attribute non-functional or cause unexpected behavior in assistive technologies.
The Algorithm (in Simple Terms)
-
Identify elements with attributes that start with
aria-
. -
For each attribute, check:
-
Is the value among the allowed options?
-
Is it spelled exactly as specified in the standard?
-
-
Flag the element if any attribute has an invalid or unsupported value.