Start a project

Tool 36 of 194 · Accessibility

Focus Order & Keyboard Trap Analyser

Paste HTML and CSS to see the Tab order numbered on the page, and find missing focus styles, positive tabindex, out-of-order stops and focusable hidden content.

Focus Order & Keyboard Trap Analyser at a glanceIllustration: 1, Your HTML; 2, processed in your browser; 3, Tab order.Focus Order & Keyboard Trap Analyser</>1Your HTML/old3013Tab order2In yourbrowser
1 Your HTML 2 processed on your device 3 Tab order

Focus Order & Keyboard Trap Analyser

Your HTML and CSS

    Tab order on the page

    Numbers show the order Tab visits; red means a serious problem. Scripts in your HTML don't run.

    Every stop

    #ElementAccessible nametabindexProblems

    Problems by type

    01

    What it does

    Renders pasted HTML, focuses every element in Tab order, and checks each stop for focus styles, names, order and hidden content.

    • The real Tab sequence, positive tabindex first, drawn as a numbered path
    • Focus style check: each element is focused and its style compared
    • Focusable content inside aria-hidden or off screen
    • Stops that jump back up the page against reading order

    02

    Private by design

    Everything happens in your browser. Nothing you type, paste or upload is sent anywhere, and it keeps working offline once the page has loaded.

    03

    What you get

    Tab order drawn on the page, per-stop problems and page-level findings, with a Copy and a Download button on every result.

    • Accessibility
    • Keyboard
    • Focus
    • tabindex
    • WCAG

    Why it matters

    Keyboard users move through a page with Tab, and three things go wrong again and again: the order jumps around because of a positive tabindex or CSS that reorders the layout, focus disappears because outline: none removed the only indicator, and focus lands on things nobody can see, like links inside aria-hidden or off-screen content. Checking by hand means tabbing through every page at every width.

    This analyser renders your HTML and CSS in a sandboxed frame, works out the Tab sequence the way browsers do (positive tabindex values first in ascending order, then everything else in source order, skipping disabled, hidden and inert content), and then actually focuses each element, comparing its computed outline, shadow, border, background and colour before and after to see whether anything visibly changes. Each stop is checked for an accessible name, a role, aria-hidden ancestors, off-screen position and whether Tab moves back up the page. The order is drawn over the preview as a numbered path, so a layout reordered by flex-direction or grid shows up at a glance.

    How it works

    1. InputA page or component
    2. In your browserRendered and focused stop by stop
    3. OutputThe Tab path drawn, with problems per stop

    Where it fits in a designer's workflow

    1. Plan
    2. Design
    3. Build
    4. Test
    5. Launch
    Keyboard testing before an accessibility audit.

    By the numbers

    Problems at each Tab stop in the sample page, in the order Tab visits them1. button.add: 1 problem; 2. a.logo: 1 problem; 3. a: No problems; 4. a: No problems; 5. button.search: 1 problem; 6. input#qty: 1 problem; 7. div.thumb: 2 problems; 8. div.thumb: 1 problem; 9. a: 1 problem; 10. a.offscreen: 1 problem1. button.add1 problem2. a.logo1 problem3. aNo problems4. aNo problems5. button.search1 problem6. input#qty1 problem7. div.thumb2 problems8. div.thumb1 problem9. a1 problem10. a.offscreen1 problem
    Found by this tool in its sample at 768px: 10 stops in the Tab order. 4 stops with serious problems, 4 warnings. The button with tabindex="3" goes first, so the first Tab press skips the header, and flex-direction: row-reverse makes Tab jump right to left between the quantity field and the photos. Source: W3C: Understanding SC 2.4.3 Focus Order; W3C: Understanding SC 2.4.7 Focus Visible.
    Show the numbers as a table
    #ElementNametabindexProblems
    1button.addAdd to basket3tabindex="3" jumps it ahead of the page order.
    2a.logoHartley Oak homeTab goes back up the page here (from item 1), against reading order.
    3aTablesOK
    4aChairsOK
    5button.search(no name)No accessible name.
    6input#qtyQuantityNo visible focus style: nothing changes when it's focused.
    7div.thumbPhoto 10Focusable div with no role: announced as plain text. Tab jumps right to left here (from item 6): the layout order doesn't match the source order.
    8div.thumbPhoto 20Focusable div with no role: announced as plain text.
    9aWinter saleInside aria-hidden: screen readers say nothing when it gets focus.
    10a.offscreenCare guideOff screen or tiny when focused, so sighted keyboard users lose track of focus.

    How to use it

    1. Paste the HTML and CSS.
    2. Pick the viewport width.
    3. Follow the numbered path on the preview.
    4. Fix the red stops first: no focus style, aria-hidden and positive tabindex.

    FAQ

    Why is positive tabindex bad?

    Any tabindex above 0 jumps ahead of everything else on the page, so the first Tab press goes to that element instead of the skip link or header. Use tabindex="0" and put elements in the right source order.

    What counts as a visible focus style?

    Any change in outline, box-shadow, border, background, text colour or underline when the element is focused. WCAG 2.4.7 requires one; 2.4.13 in WCAG 2.2 AAA asks for a clear, high-contrast one.

    Why does CSS order matter?

    flex-direction: row-reverse, order and grid placement move things visually but not in the Tab sequence, so focus seems to jump around (WCAG 2.4.3, Focus Order).

    Can it find keyboard traps?

    Not ones made by scripts, since scripts don't run here. It flags the static causes, like focus reaching content behind an open dialog. Test widgets and embedded players by hand.

    Why does the skip link matter?

    Without one, keyboard users tab through the whole header and navigation on every page before reaching the content (WCAG 2.4.1, Bypass Blocks).

    Work with me

    Want a site that gets these right?

    I build fast, accessible websites and web apps that pass these checks from day one. Tell me about your project and I'll reply personally with honest next steps.

    All developer tools · Back to leej.uk