R

RatedWithAI

WCAG guidance

Scan your site

WCAG 2.1

2.1.1 Keyboard

Level A success criterion

All functionality must be operable through a keyboard interface.

Why it matters

Many users rely on keyboard navigation or switch devices and cannot use a mouse.

Common violations

  • Custom dropdowns that trap focus
  • Click-only controls without keyboard support
  • Hidden modals with no focus management

Code examples

Bad

<div onClick="openMenu()">Menu</div>

Good

<button type="button" onClick="openMenu()">Menu</button>

How to fix

Use native controls when possible, add keyboard handlers, and ensure focus can move in and out of components.

Related criteria

Related resources

Scan your site

Check your WCAG coverage in minutes

Start a free scan