Clickable elements must be reachable with the keyboard

Anything that reacts to a mouse click must also work from the keyboard. A div or span with a click handler is skipped by Tab, so keyboard users cannot open, choose or submit with it.

Readabler check

Rule IDrdb-clickable-not-focusable
ImpactSerious
Success criterion 2.1.1 Keyboard · A
StandardsWCAG 2.0 · WCAG 2.1 · WCAG 2.2 · Section 508 · EN 301 549
Readabler fix Fixed automatically

Example

Before
<div class="size-picker">
  <span class="size" onclick="pickSize('M')">M</span>
  <span class="size" onclick="pickSize('L')">L</span>
</div>

Tab skips the sizes. A keyboard user cannot choose a size, so cannot buy the shirt.

After
<div class="size-picker">
  <button type="button" class="size" onclick="pickSize('M')">M</button>
  <button type="button" class="size" onclick="pickSize('L')">L</button>
</div>

Tab reaches each size, Enter or Space selects it, and screen readers announce “M, button”.

Why it matters

Native controls such as <button>, <a href> and <input> can receive focus and respond to Enter or Space without any extra work. A <div> or <span> cannot. When a script makes one clickable, it works for mouse and touch users only.

People who rely on the keyboard, such as people with motor disabilities, tremor or repetitive strain injury and switch users, cannot reach it at all. Screen reader users may not hear it announced as a control, and voice control users cannot click it by name. If the element opens a menu, picks a size or submits an order, the whole task becomes impossible.

This is a common side effect of component libraries and quick prototypes, and it fails WCAG 2.1.1 Keyboard at Level A.

How to fix it

Use a native element. A <button> for actions, an <a href> for navigation. Reset the button's look with CSS if needed:

<button type="button" class="size" onclick="pickSize('M')">M</button>
<style>
  .size { font: inherit; background: none; border: 1px solid #555; }
</style>

If you must keep the custom element, add what the browser would have given you: a role, a place in the Tab order and keyboard support:

<span class="size" role="button" tabindex="0"
  onclick="pickSize('M')"
  onkeydown="if (event.key === 'Enter' || event.key === ' ') { event.preventDefault(); pickSize('M'); }">M</span>

Whole card or row clickable. Put a real link on the title and stretch its click area with CSS, instead of a click handler on the container.

Hover-only features, like a menu that opens on mouseover: make sure the same thing opens on focus or with a button.

Checklist

  1. Use button or a href for everything clickable.
  2. Give custom controls a role and tabindex="0".
  3. Support Enter and Space on custom buttons.
  4. Tab through the page to confirm every control is reached.

How the check works

The check records elements that receive click, mouse, pointer or touch listeners while the page loads, plus elements with an onclick attribute. It reports a visible element when it is not focusable, not inside or around a native control, has no tabindex attribute and no role of none or presentation, measures between 8 by 8 pixels and a quarter of the screen, and has a pointer cursor, an onclick attribute or an interactive role. Up to 50 are reported. Handlers attached to a parent container are not detected: check those by hand.

Resources

Updated October 27, 2026