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

ARIA role is missing a required attribute

Some ARIA roles only work with certain attributes, such as role="checkbox" with aria-checked or role="slider" with aria-valuenow. Add the missing attribute, or better, use the native HTML element.

Who it hurts

Screen reader users, who hear a control with no state (“checkbox” but not whether it is ticked).

Custom toggles, sliders and tabs built from <div>s are the usual cases.

How to fix it

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

Before

<div role="checkbox">Gift wrap</div>

After

<label><input type="checkbox"> Gift wrap</label>

Check it by hand too

Operate each custom control with a screen reader on; its state should be announced as it changes.

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