Accessibility / Analysis / Keyboard Unit Tester
The Keyboard Behavior Unit Tester bookmarklet automatically tests whether interactive controls respond to keyboard activation. Finds links, buttons, and inputs, programmatically dispatches Enter and Space keyboard events, measures if click handlers were triggered, and reports elements that failed to respond to keyboard activation. Helps identify interactive elements that only work with mouse/touch input, which is a WCAG violation. Displays an alert with the count of silent (non-responsive) elements.
WCAG SC 2.1.1: Keyboard
Run Keyboard Unit Tester
Test run or drag to
bookmarklets bar to install
javascript:%21function()%7B%22use%20strict%22%3Btry%7Bconst%20e%3D%22a11y-keytest%22%2Ct%3Ddocument.getElementById(e)%3Bt%26%26t.remove()%3Bconst%20n%3D%27a%5Bhref%5D%2Cbutton%2C%5Brole%3D%22button%22%5D%2Cinput%5Btype%3D%22checkbox%22%5D%2Cinput%5Btype%3D%22radio%22%5D%27%2Co%3D%5B...document.querySelectorAll(n)%5D.filter(e%3D%3Ee.offsetParent)%2Cr%3D%5B%5D%3Bfor(const%20e%20of%20o)%7Blet%20t%3D%211%3Bconst%20n%3D()%3D%3Et%3D%210%3Be.addEventListener(%22click%22%2Cn%2C%7Bonce%3A%210%7D)%2Ce.dispatchEvent(new%20KeyboardEvent(%22keydown%22%2C%7Bkey%3A%22Enter%22%2Cbubbles%3A%210%7D))%2Ce.dispatchEvent(new%20KeyboardEvent(%22keyup%22%2C%7Bkey%3A%22Enter%22%2Cbubbles%3A%210%7D))%2Ce.dispatchEvent(new%20KeyboardEvent(%22keydown%22%2C%7Bkey%3A%22%20%22%2Cbubbles%3A%210%7D))%2Ce.dispatchEvent(new%20KeyboardEvent(%22keyup%22%2C%7Bkey%3A%22%20%22%2Cbubbles%3A%210%7D))%2CsetTimeout(()%3D%3E%7Bt%7C%7Cr.push(e)%7D%2C30)%7DsetTimeout(()%3D%3E%7Balert(r.length%3F%60Silent%20on%20Enter%20and%20Space%3A%20%24%7Br.length%7D%60%3A%22All%20tested%20controls%20responded%22)%7D%2C220)%2Cconsole.log(%22%5CnSource%3A%20https%3A%2F%2Fgithub.com%2Falejandrogiga98%2FA11y-Bookmarklets%5CnBookmarklet%20name%3A%20Keyboard%20behavior%20unit%20tester%5CnAuthor%3A%20alejandrogiga98%5CnLicense%3A%20MIT%20License%5Cn%22)%7Dcatch(e)%7Balert(%22Bookmarklet%20Error%3A%20%22%2Be.message)%7D%7D()%3B
← Back to all bookmarklets