Operable · 2.1 Keyboard Accessible

Keyboard (No Exception) WCAG 2.1.3 · Level AAA

All functionality must be operable through a keyboard interface without requiring specific timing for individual keystrokes, with no exceptions. Unlike 2.1.1, even path-dependent input such as freehand drawing must be achievable from the keyboard.

Level
AAA
Since
WCAG 2.0
Principle
Operable
Guideline
2.1 Keyboard Accessible

Live demo

Sign for a parcel without a mouse

The same task, done two ways: switch between the version that passes and the one that fails, or put them side by side. Everything in the box is live, so try it with a keyboard, a pointer or a screen reader.

Using only the keyboard, try to sign and press Confirm signature in each version. The Show tab order button numbers every control that Tab can reach.

Live example

Passes

Sign for your parcel

Your signature confirms that the parcel arrived undamaged.

Draw your signature in this box with a mouse, pen or finger.

What happened

    Why it passes

    You can still draw with a pointer, but you can also type your name as your signature and use real Clear and Confirm signature buttons, so the keyboard can do everything a mouse can.

    Why it fails

    The signature box takes focus but responds only to drawing, which 2.1.1 would excuse and this level does not. Clear and Confirm signature are plain text that Tab skips, so a keyboard user cannot sign at all.

    Examples

    Code that fails, and the fix

    Five examples, each one running: the usual ways this criterion fails, and code that passes. Listen to them, measure them, or copy the code.

    Fails

    Signature pad that only follows a pointer

    Live preview

    JavaScript
    const pad = document.getElementById("signature");pad.addEventListener("pointerdown", startStroke);pad.addEventListener("pointermove", continueStroke);pad.addEventListener("pointerup", endStroke);// No keyboard way to sign

    Drawing a signature depends on the path of the pointer, which 2.1.1 excuses. This criterion has no such exception, so keyboard users must have another way to sign.

    Passes

    Typed name as an alternative signature

    Live preview

    HTML
    <fieldset>  <legend>Sign the rental agreement</legend>  <p>Draw your signature in the box, or type your full name below.</p>  <canvas id="signature" width="400" height="120"></canvas>  <label for="typed-signature">Type your full name to sign</label>  <input id="typed-signature" name="typed-signature" type="text" autocomplete="name">  <button type="submit">Confirm signature</button></fieldset>

    Typing a name gives the same result as drawing, so the agreement can be signed with no pointer at all.

    Passes

    Arrow keys that draw on the pad

    Live preview

    JavaScript
    // The pad has tabindex="0" and a label; Space lifts or lowers the penconst moves = { ArrowUp: [0, -5], ArrowDown: [0, 5], ArrowLeft: [-5, 0], ArrowRight: [5, 0] };pad.addEventListener("keydown", (event) => {  if (event.key === " ") penDown = !penDown;  else if (moves[event.key]) {    pen.x += moves[event.key][0];    pen.y += moves[event.key][1];    if (penDown) drawTo(pen.x, pen.y);  } else return;  event.preventDefault();});

    The same freehand drawing can be made from the keyboard: arrow keys move the pen and Space lifts or lowers it.

    Fails

    Payment sent only after a timed hold

    Live preview

    JavaScript
    // "Press and hold Space for two seconds to send"let heldSince = 0;sendButton.addEventListener("keydown", (event) => {  if (event.key === " " && !event.repeat) heldSince = Date.now();});sendButton.addEventListener("keyup", (event) => {  if (event.key === " " && Date.now() - heldSince >= 2000) sendPayment();});

    Holding a key for a set time is specific timing for a keystroke, which the criterion rules out. People with tremor or slow movement may never manage it.

    Passes

    One key press plus a confirmation step

    Live preview

    HTML
    <button type="button" id="send">Send $250</button><dialog id="confirm-send" aria-labelledby="confirm-title">  <h2 id="confirm-title">Send $250 to Priya Shah?</h2>  <form method="dialog">    <button value="send">Send</button>    <button value="cancel">Cancel</button>  </form></dialog>

    Any single press of Enter or Space works, and a confirmation step guards against accidents instead of a timed hold.

    Why it matters

    Who it helps

    It guarantees that keyboard-only and assistive technology users can use every feature, including path-dependent ones that 2.1.1 allows to rely on a pointer.

    W3C: Understanding 2.1.3
    • Level AAA

      Level AAA is the highest level. It is not required for whole sites, but it is worth meeting where you can.

    • In WCAG versions

      Part of WCAG 2.0 since December 2008, and of every version after it.

      WCAG 1.0 checkpoints: 6.4, 9.2, 9.3

    • Where it is required

      No law on this site requires Level AAA criteria for whole sites.

    How to test

    Checking it

    A few concrete steps. Automated tools find some failures; most need a person.

    1. Repeat the 2.1.1 keyboard walkthrough for every feature on the page, with no allowance for path-dependent input.
    2. For drawing, signature, freehand selection or similar tools, confirm there is a keyboard way to produce the same result.
    3. Confirm that no keystroke must be made within a time window or held for a set duration.

    Common failures

    Where it breaks

    • A drawing or annotation tool can be used only by moving a mouse, stylus or finger.
    • A signature field can be completed only by drawing, with no keyboard-operable alternative.