Operable Guideline 2.1 Keyboard Accessible

2.1.1 Keyboard

Everything must work with a keyboard alone

Level A 3 automated checks

What it asks for, in plain English

Anything a person can do with a mouse or a finger, they must also be able to do with a keyboard: reach it, operate it, and get the same result. That includes custom dropdowns, date pickers, carousels, modal dialogs, sliders, chat widgets and anything built from a <div> with a click handler.

It also means no reliance on timing. A person must not have to press keys quickly or hold them for a set time to make something work.

The one exception is input where the path of the movement is the point, such as freehand drawing. Even then, the surrounding controls (colour, undo, save) must still work with keys.

This is an independent explanation. The binding wording is the W3C Recommendation, and the W3C's own Understanding 2.1.1 page has the full intent, techniques and definitions.

Who it affects

Someone who is blind uses a screen reader with the keyboard only, and cannot click a 'button' that is really a div with no keyboard handling.

A person with a tremor or repetitive strain injury cannot use a mouse accurately and relies on Tab and Enter for everything.

A power user with a broken trackpad finds the custom dropdown will not open and abandons the form.

Example

Broken
<div class="btn" data-action="add-to-basket">Add to basket</div>
<span class="link" data-action="open-size-guide">Size guide</span>

Both get a click handler in script, so they work with a mouse. Neither can receive keyboard focus: Tab skips straight past them and Enter does nothing.

Fixed
<button type="button" data-action="add-to-basket">Add to basket</button>
<a href="#size-guide" data-action="open-size-guide">Size guide</a>

Same click handler, but real buttons and links are focusable and respond to Enter (and Space for buttons) with no extra work.

How to check it

  1. Put the mouse out of reach. Starting at the top of the page, press Tab repeatedly and note every control you reach.
  2. Compare with what you can see. Any link, button or control you could click but never reached is a failure.
  3. At each control, use Enter, Space and the arrow keys to operate it. Menus should open, tabs should switch, sliders should move.
  4. Open a dialog or a dropdown and use it fully with keys, then close it and check focus comes back to where you were.

What Websight checks for 2.1.1

Websight runs these automated checks for 2.1.1:

Websight flags scrollable areas that keyboard users cannot reach, server-side image maps and frames whose content cannot be focused. It cannot operate a custom widget to see whether the keys work, so this is on the manual checklist.

Practical tips

  • Use <button> and <a href> for anything clickable. They come with focus and key handling built in.
  • If you must make a div interactive, give it tabindex="0", a role, and key handlers for Enter and Space.
  • Check third-party embeds (maps, chat, video) with the keyboard too; you are responsible for what is on your page.

Scan your page and see where 2.1.1 stands

Websight gives a score out of 100, explains each automated finding in plain English, and lists the checks a person still needs to do.

Add Websight to Chrome

Free scans, no account, nothing leaves your computer. Automated tools find only part of the problems; the extension says so on every report.