- Success Criterion 2.1.1
- Conformance level A
Focusable Element That Enter and Space Don’t Actually Activate
2.1.1 — Keyboard
Scenario
Setting
A crowdfunding platform's campaign page
What’s wrong
Element focusable but Enter/Space do nothing (no keydown/keyup activation).
Example
<div class="pledge-btn" tabindex="0" onclick="openPledgeModal()">
Back this project
</div> Why it matters
A backer can tab to the pledge button and see it highlighted, but pressing Enter does nothing, so they assume the campaign is broken.
How to test
Tab to the control and press Enter, then Space: if the click handler only fires on mouse click and neither key does anything, it fails.
How to fix
onclick alone never catches keydown on a div; add explicit handling for both Enter and Space, or use a real button instead.
<div class="pledge-btn" tabindex="0" role="button"
onclick="openPledgeModal()"
onkeydown="if(event.key==='Enter'||event.key===' '){event.preventDefault();openPledgeModal();}">
Back this project
</div> Outcome
A backer tabs to the button, presses Enter or Space, and lands in the pledge modal immediately.
Who is affected
Keyboard-only users reach the control but can never trigger it, a focusable-but-frozen trap that is especially confusing.
Learn more
- Understanding Understanding document (opens in a new tab)
Related scenarios
- Feature That Only Responds to Mouse Events, Not the Keyboard
- Element That Loses Focus the Instant It’s Reached by Keyboard
- Clickable Element Acting Like a Link With No Real Keyboard Role
- Clickable Div With No Keyboard Focus or Key Handling at All
- Custom Dropdown That Can’t Be Operated by Keyboard Arrows
- Drag-and-Drop Feature With No Keyboard Alternative