HighWCAG 4.1.2 · Level ARobust
ARIA Accordion / Widget State Contract
Validates aria-expanded toggle state transitions and verifies that aria-controls points to existing DOM target elements.
Rule ID: custom-widget-contract · reported under Needs review, because a person should confirm it.
Who this affects
Screen-reader and voice-control users cannot tell what a control is, what it is called or what state it is in.
WCAG 4.1.2 Name, Role, Value: read the W3C explanation of Name, Role, Value
How to fix it
Problem
<button onclick="toggle()">Accordion</button>Fixed
<button aria-expanded="true" aria-controls="panel-1" onclick="toggle()">Accordion</button>
<div id="panel-1">Content</div>These are short examples. In the extension, A11yEngine points to the element on your own page and can suggest a fix for your code (HTML, React, Vue or Tailwind).
Find this on your own pages
Check any page for this and 100+ other issues in your browser, free.