The Logical Focus Order Checker scans pasted HTML for the structural patterns most likely to break keyboard navigation: modals and drawers that do not trap focus, custom widgets with no keyboard affordances, and tabindex values that scramble the natural focus order. It is built for developers and accessibility testers who need a fast first pass before a full WCAG audit. Everything is parsed in your browser, so internal markup never leaves your device.
How it works
The tool loads your markup into the browser’s built-in DOMParser and runs a series of targeted queries against the resulting document:
- Positive tabindex — any element with
tabindexgreater than0is flagged, because positive values override source order and create an illogical tab sequence (WCAG 2.4.3). - Modal-like containers — elements with
role="dialog", a native<dialog>, or class names containingmodal,drawer,overlay, orpopupare checked for a dialog role andaria-modal="true". - Custom widgets — dropdowns, date pickers, carousels, tabs, and tooltips are inspected for at least one natively focusable child and ARIA state such as
aria-expandedoraria-haspopup. - Click handlers on non-interactive elements — an
onclickon adiv,span,li, orimgwithout bothtabindex="0"and aroleis reported, because keyboard users cannot reach it.
Tips and notes
A passing result is a starting point, not a certificate. Static analysis cannot execute your JavaScript, so it cannot confirm that focus is actually moved into a dialog or returned afterwards. Always finish with a real keyboard-only pass: open each interactive component, press Tab and Shift+Tab to confirm focus stays logical, and press Esc to confirm you can escape. For dialogs, verify focus lands inside on open and returns to the trigger on close.
When the tool flags an onclick on a div, the correct fix is usually to swap in a real <button>. Native elements come with focusability, role, and Enter/Space handling for free, which removes a whole class of focus-order defects.