Skip to content
easeweb
Search topics

Invalid ARIA that misleads screen readers

A checkout's custom gift-wrap checkbox writes its state as "yes" and "no", or its role as aria-role, words ARIA doesn't define, so a screen reader hears a box stuck in one state, or no checkbox at all.

WCAG 2.2
SC 4.1.2A
Required by
Section 508 · EN 301 549 (EU)
Broken aria-checked="no"
The accessibility problem illustrated: No vision:Did I tick it or not?
01

The problem

Screen reader users can't tell whether gift wrap is chosen, or that the box can be ticked at all.

02

Try it

Tab to the gift-wrap box, then tick it and clear it with Space.

Compare the box with what a screen reader says, with it empty and with it ticked. Does the voice follow the tick?

Broken Can you fix this?

Screen reader says:

(Tab to the box)

A recreated demo. The broken version is intentionally inaccessible.

03

The fix

Write every role, attribute and value exactly as ARIA defines it, or use a native checkbox and drop the ARIA.

  1. 1Use only words ARIA defines: role, not aria-role; "true" and "false", not "yes" and "no".
  2. 2Put each ARIA attribute only on a role that supports it, and never restate a native control's own state.
  3. 3Check the rendered markup in every state, not only as the page loads.
Before

The state written as "yes" and "no"

<div class="tick-box" role="checkbox" aria-checked="no" tabindex="0">  Gift wrap this order</div>
After

The ARIA written as ARIA defines it

<div class="tick-box" role="checkbox" aria-checked="false" tabindex="0">  Gift wrap this order</div>

Fixing this with an AI coding assistant? Get this guide as Markdown, or get every guide in your coding agent.

04

Verify the fix

5 checks.

Test with: Screen reader, Keyboard, Mouse

0 of 5 checked

Record the OS, browser and assistive-technology versions, the build, the date, and the actual result of each step. Repeat whenever the component or the code that saves its state changes.

Limits

This is a starting pattern, not a guarantee for every application. Class names are placeholders, and the checkbox stands for any custom control whose ARIA is written by hand. Browsers handle author errors in their own ways and change between versions, so a page that sounds right in one browser proves little. Valid ARIA is not the same as correct ARIA: a scan that reports nothing can't tell you that a role suits the control or that its state follows the screen. Test the complete journey with your target assistive technology.

This is a recreated teaching example, not a finding about a named client. The code is a starting pattern: test it in your own product. No completed assistive-technology test is claimed here.

Keep this fixed as your code changes.

Turn guides like this into rules your coding agents and CI follow, then have the result retested with a keyboard and screen readers.

How retests work