Performance: Labels and placeholders
MEDIUM IMPACT
This concept affects page accessibility and user interaction responsiveness, indirectly influencing user experience and input delay.
<label for="name">Name</label> <input id="name" type="text" placeholder="Enter your name">
<input type="text" placeholder="Enter your name">
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Input with placeholder only | Minimal DOM nodes | 0 reflows | Low paint cost | [!] OK but poor accessibility |
| Input with label and placeholder | One extra DOM node (label) | 0 reflows | Slightly higher paint cost | [OK] Good for accessibility and INP |