Performance: Keyboard navigation basics
MEDIUM IMPACT
This affects user interaction responsiveness and accessibility, impacting how quickly users can navigate and interact with page elements using the keyboard.
<button onclick="doSomething()">Click me</button>
<div onclick="doSomething()">Click me</div>
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Non-semantic clickable div without keyboard support | Low | 0 | Low | [X] Bad |
| Semantic button element with native keyboard support | Low | 0 | Low | [OK] Good |
| Using tabindex="-1" to remove focusable elements | Low | 0 | Low | [X] Bad |
| Natural DOM order with no tabindex manipulation | Low | 0 | Low | [OK] Good |