← All analysers · Multi-model analysers
MouseOnlyClickAnalyzer
Reports click handlers without a keyboard equivalent. Cross-file aware.
What it detects
Many false positives on `<div onclick>` come from single-file linters that can't see the keyboard handler in another file. This analyser walks the integrated DocumentModel and reports a click handler only when no equivalent keyboard handler is registered against the same selector across any source file.
WCAG criteria
- 2.1.1 — Keyboard
- 4.1.2 — Name, Role, Value
Example
<!-- index.html -->
<div onclick="save()">Save</div>
<!-- handlers.js (separate file) -->
// no keydown handler — this is a real failureParadise reports: Element `<div>` has a click handler but no keyboard equivalent. Add `keydown` for Enter/Space, or use `<button>`.