Skip to content
SilktideHelp

Invalid ARIA attribute value

Silktide checks the value of every ARIA attribute on your pages against the values the standard allows for it. An attribute with a wrong value, such as a checkbox state of "yes" instead of "true", is ignored by browsers, so the state it describes is never announced.

<!-- Problem: "yes" is not a valid value, the state is dropped -->
<div role="checkbox" aria-checked="yes">Subscribe</div>

<!-- Fix: use the defined token -->
<div role="checkbox" aria-checked="true">Subscribe</div>

Why this matters

Every attribute defines exactly which values it accepts, and browsers discard anything else rather than guess. The mistakes are usually intuitive-looking values - aria-expanded="1", aria-checked="yes", aria-level="0" - that pass every visual test while users get a control with no announced state: a menu that never says whether it is open, a checkbox that never says whether it is checked.

How to fix it

  1. Replace informal values with the tokens the attribute defines: true and false rather than yes, no, 1, or 0.
  2. Check numeric attributes: counting attributes such as aria-level and aria-rowindex start at 1, not 0.

The exact values allowed by each attribute are listed in the MDN ARIA attribute reference.

How Silktide tests this

  1. Find every element on the page that carries at least one aria- attribute.
  2. Check each attribute's value against the type ARIA 1.2 defines for it: true/false attributes, three-state attributes such as aria-checked and aria-pressed (true, false, mixed, or undefined, which means the state is not set), numbers and whole numbers, and attributes with fixed word lists such as aria-live and aria-current.
  3. Report each value that does not conform, saying what was expected.

An attribute left empty, such as aria-live with no value, is not reported here. Browsers ignore an empty value, so the attribute behaves as if it were not there: an empty aria-live works the same as off. If the element's role needs the attribute, Missing required ARIA attribute reports it as missing.

Attributes that reference element IDs are tested by their own checks, such as Missing aria-controls ID, and free-text attributes like aria-label accept any text.

Troubleshooting

The value is set by a framework

Component libraries occasionally serialize states incorrectly (for example, rendering aria-expanded="null"). The finding points at the element, but the fix usually belongs in how the component is configured or in a library update.

Learn more

Last updated

Was this page helpful?