Do you still need jQuery, and what are the modern equivalents?

jQuery Fundamentals Basic 1–2 Yrs2–3 Yrs3–5 Yrs Conceptual 1 min read

Quick Answer

For new projects, usually not — modern browsers have native equivalents for what jQuery solved: querySelector/querySelectorAll for selection, classList for classes, addEventListener for events, fetch for AJAX, and Promise/async-await. jQuery is still everywhere in existing ASP.NET MVC and Web Forms apps, so maintenance roles still use it.

For a new project I wouldn't add it. The things jQuery existed to smooth over — inconsistent selectors, class manipulation, AJAX, event binding — all have clean native APIs now: querySelectorAll, classList, addEventListener, fetch. But it's still in a massive number of ASP.NET MVC and Web Forms apps, and things like Bootstrap 4 and DataTables depend on it, so if I'm maintaining one of those I'll use it rather than fight it. It's a “don't add it, but don't rip it out for its own sake” situation.

jQueryModern native
$('.x')document.querySelectorAll('.x')
.addClass / .toggleClassel.classList.add / .toggle
.on('click', fn)el.addEventListener('click', fn)
$.ajax / $.getJSONfetch(url).then(r => r.json())
.closest / .findel.closest() / el.querySelector()
$(document).readyDOMContentLoaded or <script defer>

What jQuery still gives you: terse chaining, cross-old-browser consistency, and a huge plugin ecosystem (including Bootstrap 4 and DataTables). If a codebase already loads it, using it is fine; adding it to a greenfield project is hard to justify.