Skip to main content
Raasta
CriticalWCAG 4.1.2 · Level Aaria-valid-attr-value

ARIA attribute has an invalid value

An ARIA attribute with a value it doesn’t accept, such as aria-expanded="yes" or an aria-controls pointing at an id that isn’t on the page, is ignored or misreported. Use one of the allowed values and make sure any id it references exists.

Who it hurts

Screen reader users, who hear the wrong state (or none) for menus, accordions and tabs.

Common after a redesign renames ids, or when a script writes “yes”/“no” instead of “true”/“false”.

How to fix it

Pick your stack. Review every change before you ship it.

Before

<button aria-expanded="yes">Menu</button>

After

<button aria-expanded="true">Menu</button>

Check it by hand too

Open and close each menu, accordion and dialog with a screen reader on. “Expanded” and “collapsed” should be announced correctly each time.

Automated checks find a large share of accessibility problems, but not all of them. Passing this check does not on its own make a page compliant.

WCAG reference