2.1.1 Keyboard
Level A Since WCAG 2.0 How it is checked: Robot
In plain language
Every function must work with the keyboard alone: opening menus, pressing buttons, picking dates, submitting forms, closing dialogs…
Who is affected
- People with motor disabilities using only a keyboard
- Blind people using screen readers
Examples
Fails
<div class="nut" onclick="guiHoSo()">Submit application</div> <!-- cannot be reached with Tab or activated with Enter -->Passes
<button type="button" onclick="guiHoSo()">Submit application</button>How to fix
- Use native elements: button, a href, input, select – they support the keyboard out of the box.
- If you must use a div: add tabindex="0", a suitable role, and handle the Enter/Space keys.
- Dropdown menus must open with the keyboard, not only on mouse hover.
How to test it yourself
- Put the mouse away and use only Tab, Shift+Tab, Enter, Space and the arrow keys to complete every main task on the page.
What WCAG.win checks
WCAG.win checks part of this criterion automatically. The rest still needs a person.
- Automated checker – rule
frame-focusable-content: Frames with focusable content must not have tabindex=-1 - Automated checker – rule
scrollable-region-focusable: Scrollable region must have keyboard access - Automated checker – rule
server-side-image-map: Server-side image maps must not be used
W3C documentation: Understanding Success Criterion 2.1.1: Keyboard