The short answer: you don’t need to learn jQuery. But being able to read it pays off. This article lays out why you can skip learning it, and why reading it is still worth something—through concrete correspondences.
What jQuery was solving
Around 2010, web development had two big annoyances.
- Browsers wanted different code—doing the same thing often meant writing one version for Internet Explorer and another for everything else
- Plain JavaScript was verbose—everyday things, like grabbing a set of elements and acting on all of them, took several lines
jQuery wrapped both of those in one short syntax. At the time, there was no reason not to use it.
Both of those are now solved
Browsers have converged on the same syntax, and plain JavaScript gained shorter forms. Here’s the correspondence for the things you’ll actually see.
| jQuery | Plain JavaScript today |
|---|---|
$('.card') | document.querySelectorAll('.card') |
$('#title') | document.querySelector('#title') |
.text('Hello') | .textContent = 'Hello' |
.html('<b>Bold</b>') | .innerHTML = '<b>Bold</b>' |
.addClass('on') | .classList.add('on') |
.removeClass('on') | .classList.remove('on') |
.toggleClass('on') | .classList.toggle('on') |
.on('click', fn) | .addEventListener('click', fn) |
.attr('href', url) | .setAttribute('href', url) |
.css('color', 'red') | .style.color = 'red' |
$.ajax(...) | fetch(...) |
$(document).ready(fn) | put script just before </body> (or use defer) |
As you can see, it’s the same work. Only the names differ; there’s no new concept to relearn.
CourseWeb animationAdding motion with CSS, in the web animation courseWhy reading it is still worth it
It’s a tool that “won’t be chosen for new work”—but it keeps running on sites already published. These are the three places you’re most likely to meet it.
- WordPress themes and plugins—WordPress ships jQuery itself, so it’s still widely used
- Maintaining a site built a few years ago—“could you just fix this bit?” work almost always sits on top of existing code
- Tutorials online—older articles assume jQuery. If you can read them, you can translate as you go
So the reading skill pays off in maintenance, and the writing skill isn’t needed. Knowing that asymmetry keeps you from wasting study time.
TipsHow to read jQueryHow to read$() and method chaining, in this articleTwo errors that trip people up
Just the ones you’ll meet while touching an existing site, so you can stay calm.
$ is not defined
It means your jQuery code ran before jQuery itself loaded. Fix the order of the script tags.
<!-- the library first -->
<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
<!-- your own code after -->
<script src="script.js"></script>On WordPress, the order isn’t decided by tag order but by declaring the dependency.
TipsThe right way to load CSS and JavaScript (wp_enqueue)Loading CSS and JavaScript properly in WordPress, dependencies included$ doesn’t work in WordPress
To avoid clashing with other libraries, WordPress loads jQuery with the $ alias disabled. So $('.card') throws. Wrapping it like this makes $ available inside.
jQuery(function ($) {
// $ works in here
$('.card').addClass('is-ready');
});This isn’t jQuery being broken—it’s how WordPress works. When you see existing theme code in this shape, that’s why.
Deciding whether to use it
| Situation | What to do |
|---|---|
| You’re learning | Plain JavaScript. Skip jQuery |
| Building a new site | Plain JavaScript. No reason to add it |
| Maintaining an existing site | Match the site. If it’s already there, use it happily |
| Touching a WordPress theme | If the existing code is jQuery, match it. New code can be plain JS |
| Following an old tutorial | Translate it and write plain JS |
What you most want to avoid is mixing plain JavaScript into a site already written in jQuery, so it ends up with two styles. Within one file, matching that file’s conventions is the basis of readability.
Summary
- The browser differences and verbosity jQuery solved are already solved
- So there’s no need to learn it. Learn plain JavaScript instead
- But it keeps running in WordPress and existing sites—reading it keeps maintenance painless
$ is not definedis load order;$not working in WordPress is by design- When touching an existing site, match that file’s conventions
Knowing an older tool isn’t a detour. Just being able to read it widens the range of work you can take on.