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 an incorrect 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.
  3. Remove attributes left empty, such as aria-checked="" - if there is no state to convey, the attribute should not be present.

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 (true, false, mixed), 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.

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 serialise states incorrectly (for example, rendering aria-expanded="undefined"). The finding points at the element, but the fix usually belongs in how the component is configured or in a library update.

This check reports nothing even though I expect findings

ARIA testing can be turned off per website. Check the advanced settings for the website.

Learn more

Last updated

Was this page helpful?