Accessibility Certified – Home

2.1.1 Keyboard

Every function of the page must work with a keyboard alone, without needing exact timing for individual keystrokes.

Level APrinciple 2: Operable

What does it mean?

Anything a visitor can do with a mouse or a finger must also be possible with the keyboard: opening menus, using sliders, closing dialogs, filling in and sending forms, playing media. The keyboard user must not need to press keys at a particular speed or rhythm.

The only exception is a function where the result depends on the path of the movement itself, such as freehand drawing or a signature pad. Even then, related controls (choosing a colour, saving, clearing) must still work by keyboard.

Who does it help?

  • Blind people who use a screen reader and navigate by keyboard
  • People with tremors or limited hand movement who cannot use a mouse precisely
  • People who use switch devices, sip-and-puff controls or voice control that emulate keystrokes
  • Power users who simply prefer the keyboard

Common failures

  • A menu built from a div with a click handler that cannot receive focus
  • A dropdown or mega menu that opens only on mouse hover
  • A custom slider or date picker that reacts to mouse drag but not to arrow keys
  • A cookie banner whose buttons are images with click handlers and no keyboard access
  • Elements given tabindex="-1" or hidden from focus while they still need to be used

How we test it

  • axe-core Automatic: axe-core finds typical violations. A violation is pre-filled as “fails”.
  • evidence Evidence: our scanner collects material such as screenshots, lists and measurements.

Test question: Can every function be reached and used with the keyboard alone (menus, sliders, dialogs, forms)?

A person decides every criterion. No criterion ever passes automatically.

How to fix it

Problem
<div class="menu-toggle" onclick="toggleMenu()">Menu</div>
Better
<button type="button" class="menu-toggle"
        aria-expanded="false" aria-controls="main-menu">Menu</button>

<script type="module">
  const btn = document.querySelector('.menu-toggle');
  btn.addEventListener('click', () => {
    const open = btn.getAttribute('aria-expanded') === 'true';
    btn.setAttribute('aria-expanded', String(!open));
  });
</script>

A native button is focusable and fires its click event on Enter and Space, so the keyboard support comes for free.

Practical tips

  • Put the mouse aside and use the whole site with Tab, Shift+Tab, Enter, Space, Escape and the arrow keys.
  • Prefer native elements (button, a href, input, select, details) over custom widgets; they bring keyboard handling with them.

Guides and patterns on this

Official source

Understanding WCAG 2.2 at the W3C: 2.1.1 Keyboard

How does your website do on this criterion?

The free check tests your home page automatically; the audit decides all 55 criteria.

Free checkAll criteria