Performance: Global attributes
LOW IMPACT
Global attributes affect how elements behave and interact, impacting rendering and user experience consistency.
<button aria-label="Button">Click me</button>
<div onclick="doSomething()" tabindex="0" aria-label="Button">Click me</div>
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Using many global attributes on non-semantic elements | Increased event listeners | Multiple reflows on interaction | Moderate paint cost | [X] Bad |
| Using semantic elements with minimal global attributes | Minimal event listeners | Single reflow on interaction | Low paint cost | [OK] Good |