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

ARIA attribute not allowed on this element

An ARIA attribute that doesn’t belong to an element’s role, such as aria-checked on a plain button or aria-pressed on a link, is ignored or announced in a confusing way. Remove the attribute, or use the one that role supports, such as aria-pressed on a button or aria-current on a link.

Who it hurts

Screen reader users, who hear a state that doesn’t match the control, or miss the state altogether.

Usually copied from a different kind of widget. Native checkboxes with aria-checked are a common case: the ARIA value can contradict the real ticked state.

How to fix it

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

Before

<button aria-checked="true">Bold</button>

After

<button aria-pressed="true">Bold</button>

Check it by hand too

Operate the control with a screen reader on. The state you hear (pressed, selected, current, ticked) should match what you see.

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