aria-valid-attr-value

aria-* attribute values must match their declared type

automaticWCAG 4.1.2 (A)confidence: highseverity: seriousrobust

Checks that every recognized aria-* attribute has a value conforming to its WAI-ARIA-declared value type (boolean, tristate, token, integer, number, or ID reference).

Applies to. Applies to any element carrying at least one recognized aria-* attribute (unrecognized attribute names are aria-valid-attr's concern, not evaluated here).

Expectation. Each attribute's value conforms to its WAI-ARIA-declared value type: boolean ("true"/"false"), tristate ("true"/"false"/"mixed"), a token from a fixed enumerated set, an integer, a real number, or an ID reference (list) that resolves to an existing element in the document. Per ACT 6a7281's own applicability ("any state or property that is NOT empty"), an explicitly empty value, including a bare boolean-style attribute with no "=value" at all, e.g. `aria-checked` alone, is out of scope for every value type, not a violation: a common, deliberate pattern in templated markup (e.g. React conditionally rendering `aria-describedby={hasError ? errorId : ''}`).

Examples

pass
<div aria-hidden="true"></div>

"true" is a valid value for the boolean-typed `aria-hidden`.

fail
<div aria-hidden="yes"></div>

`aria-hidden` is boolean-typed; "yes" isn't a valid boolean token.

View source