- Success Criterion 4.1.2
- Conformance level A
Disabled Control That’s Only Disabled Visually, Not in Code
4.1.2 — Name, Role, Value
Scenario
Setting
A university's online course catalog
What’s wrong
Disabled conveyed visually only (class="disabled") while control stays enabled to assistive technology — state mismatch.
Example
<button class="register-btn disabled" onclick="register(courseId)">Register</button>
<!-- CSS grays it out and blocks pointer clicks, but there's no disabled attribute or aria-disabled,
and the onclick handler still fires for keyboard Enter --> Why it matters
A screen reader or keyboard user can still activate "Register" on a full course and gets an unexplained error.
How to test
Inspect a 'disabled-looking' control in DevTools: check whether the disabled attribute (or aria-disabled) is actually set — if it's only styled to look disabled but remains enabled to AT, it fails.
How to fix
Use the native disabled attribute, or aria-disabled with the handler removed, instead of styling alone.
<button class="register-btn" disabled aria-disabled="true">Register</button>
<!-- or, to keep it focusable for a tooltip explanation: aria-disabled="true" with the onclick removed --> Outcome
A student hears "Register, dimmed" and knows immediately the course is already full.
Who is affected
Screen reader and keyboard users browsing full courses cannot tell registration is closed until they hit an error.
Learn more
- Understanding Understanding document (opens in a new tab)
Related scenarios
- Custom Dropdown or Slider With No Accessibility API Support
- Content Changes That Never Update Their Accessible Name
- Scripted Link or Button With No Real Role or Keyboard Support
- Clickable Div Turned Into a Control but Given No ARIA Role
- Form Field With No Programmatic Label at All
- Assistive Technology Never Told Which Element Currently Has Focus