Svelte · Junior · Question 70 of 76
What does the Svelte compiler warn about with <div onclick={...}>?
- ✓Correct answer: Accessibility: a non-interactive element with a click handler needs a role, keyboard handling and focus, or should be a
<button> - 2Performance: divs can't have handlers
- 3Nothing, it's fine
Explanation
Svelte includes a11y checks at compile time, which catch many problems early.