Modern browsers expose querySelector, classList, fetch, and addEventListener. jQuery still wins on consistency when a codebase already centralizes behavior through $.
When vanilla is enough
One-off toggles, single fetch calls, or new micro-widgets isolated from legacy globals—write plain DOM APIs and avoid adding another dependency.
When jQuery stays
Deep plugin ecosystems, chained animations, or hundreds of selectors already written—migrate incrementally with tests.
Self-check
- Rewrite one
$('#x').addClassline usingclassListmentally. - What test would you run before merging?