20 Years! I remember when jQuery first release I thought in 5 to 10 years time we wont need jQuery because everything jQuery has will be built into the browser or becomes part of HTML Spec.<p>But then Google, Chrome, iPhone, PWA or JS for everything took over and took a completely different path to what I imagine webpage would be.
Related: This is a nice write-up of how to write reactive jQuery. It's presented as an alternative to jQuery spaghetti code, in the context of being in a legacy codebase where you might not have access to newer frameworks.<p><a href="https://css-tricks.com/reactive-jquery-for-spaghetti-fied-legacy-codebases-or-when-you-cant-have-nice-things/" rel="nofollow">https://css-tricks.com/reactive-jquery-for-spaghetti-fied-le...</a>
This brought me flashbacks of jQuery spaghetti monsters from years ago, some were Backbone related. In retrospect, over-engineered React code can be worse than decently organized jQuery code, but some jQuery mess was worse than any React code. So I guess I'm saying, React did raise the bar and standard of quality - but it can get to be too much, sometimes a judicious use of old familiar tool gets the job done.
The last major jquery app I wrote ended up using a similar reactive pattern. I had to shoehorn a custom search engine frontend into a Joomla CMS where I wasn’t allowed to change much. Good times!
I used this approach before and it indeed works better than the 2010-style jQuery mess. A good fit for userscripts too, where the problem you attempt to solve is fairly limited and having dependencies, especially with a build steps, is a pain. Note that you don't need jQuery for this at all, unless you are somehow stuck with ancient browser support as a requirement - querySelector, addEventListener, innerHtml - the basic building blocks of the approach - have been available and stable for a long time.
That's a very nice pattern indeed. If you add signals, the update function even gets called automatically. That's basically what we do in [Reactive Mastro](<a href="https://mastrojs.github.io/reactive/" rel="nofollow">https://mastrojs.github.io/reactive/</a>) ;-)
Still one of my favourite libs on the whole planet. I will always love jQuery. It is responsible for my career in (real) companies.<p>Live on jQuery! Go forth and multiply!
all these kids chasing the new frameworks...jQuery and .NET framework have always kept me fed!
Someone should just hook up a virtual dom to jQuery, it's got a whole plugin ecosystem that AI could really re-use. Jquery + Jquery UI + Jquery Plugins + AI is probably a super power we're all overlooking.
so true, 15 years of jQuery for me, it's my go to.
Whenever HTMX comes up here, I always think "isn't that just some gobbledy-gook which replaces about 3 lines of imperative jquery?"<p>Anyway, jQuery always did the job, use it forever if it solves your problems.
The problem with jQuery is that, being imperative, it quickly becomes complex when you need to handle more than one thing because you need to cover imperatively all cases.
Yeah, that's the other HN koan about "You probably don't need React if..." But if you are using jquery/vanilla to shove state into your HTML, you probably actually do need something like react.
Part of me feels the same way, and ~2015 me was full on SPA believer, but nowadays I sigh a little sigh of relief when I land on a site with the aesthetic markers of PHP and jQuery and not whatever Facebook Marketplace is made out of. Not saying I’d personally want to code in either of them, but I appreciate that they work (or fail) predictably, and usually don’t grind my browser tab to a halt. Maybe it’s because sites that used jQuery and survived, survived because they didn’t exceed a very low threshold of complexity.
These days I’ve moved to native JS, but hot damn the $() selector interface was elegant and minimal vs document.getElement[s]by[attribute)].<p>While presumably jquery is slower than native selectors, maybe that could be pre-computed away.
In case you missed them: check out querySelector and querySelectorAll. They are closer to what the jQuery selector system does, and I think they were inspired by it.<p>If the verbosity bothers you, you can always define an utility function with a short name (although I'm not personally a fan of this kind of things).<p><a href="https://developer.mozilla.org/docs/Web/API/Document/querySelector" rel="nofollow">https://developer.mozilla.org/docs/Web/API/Document/querySel...</a><p><a href="https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll" rel="nofollow">https://developer.mozilla.org/docs/Web/API/Document/querySel...</a><p><a href="https://developer.mozilla.org/docs/Web/API/Element/querySelector" rel="nofollow">https://developer.mozilla.org/docs/Web/API/Element/querySele...</a><p><a href="https://developer.mozilla.org/docs/Web/API/Element/querySelectorAll" rel="nofollow">https://developer.mozilla.org/docs/Web/API/Element/querySele...</a>
body.qsa('.class').forEach(e=>):
Yes, add qs() and Array.from(qsa()) aliases to the Node prototype, and .body to the window, and you’ve saved yourself thousands of keystrokes. Then you can get creative with Proxy if you want to, but I never saw the need.
const $ = document.querySelector.bind(document);<p>const $$ = document.querySelectorAll.bind(document);
The $ (and $$) selector functions live on in chrome/chromium devtools!
Very simple jquery implementation with all the easy apis:<p><pre><code> (function (global) {
function $(selector, context = document) {
let elements = [];
if (typeof selector === "string") {
elements = Array.from(context.querySelectorAll(selector));
} else if (selector instanceof Element || selector === window || selector === document) {
elements = [selector];
} else if (selector instanceof NodeList || Array.isArray(selector)) {
elements = Array.from(selector);
} else if (typeof selector === "function") {
// DOM ready
if (document.readyState !== "loading") {
selector();
} else {
document.addEventListener("DOMContentLoaded", selector);
}
return;
}
return new Dollar(elements);
}
class Dollar {
constructor(elements) {
this.elements = elements;
}
// Iterate
each(callback) {
this.elements.forEach((el, i) => callback.call(el, el, i));
return this;
}
// Events
on(event, handler, options) {
return this.each(el => el.addEventListener(event, handler, options));
}
off(event, handler, options) {
return this.each(el => el.removeEventListener(event, handler, options));
}
// Classes
addClass(className) {
return this.each(el => el.classList.add(...className.split(" ")));
}
removeClass(className) {
return this.each(el => el.classList.remove(...className.split(" ")));
}
toggleClass(className) {
return this.each(el => el.classList.toggle(className));
}
hasClass(className) {
return this.elements[0]?.classList.contains(className) ?? false;
}
// Attributes
attr(name, value) {
if (value === undefined) {
return this.elements[0]?.getAttribute(name);
}
return this.each(el => el.setAttribute(name, value));
}
removeAttr(name) {
return this.each(el => el.removeAttribute(name));
}
// Content
html(value) {
if (value === undefined) {
return this.elements[0]?.innerHTML;
}
return this.each(el => (el.innerHTML = value));
}
text(value) {
if (value === undefined) {
return this.elements[0]?.textContent;
}
return this.each(el => (el.textContent = value));
}
// DOM manipulation
append(content) {
return this.each(el => {
if (content instanceof Element) {
el.appendChild(content.cloneNode(true));
} else {
el.insertAdjacentHTML("beforeend", content);
}
});
}
remove() {
return this.each(el => el.remove());
}
// Utilities
get(index = 0) {
return this.elements[index];
}
first() {
return new Dollar(this.elements.slice(0, 1));
}
last() {
return new Dollar(this.elements.slice(-1));
}
}
global.$ = $;
})(window);</code></pre>
jQuery but gets compiled out like svelte... Not a bad idea at all.
I pretty much use HTMX and vanilla JS to solve most problems, when I use Django at least. Keeps things simple and gives that SPA feel to the app too.
Nice to see it still around and updated. The sad part is I guess this means React will be around in 2060.
What's wrong with React?<p>It made it so much better to build apps vs. spaghetti jQuery.<p>I still have nightmares about jeeping track of jQuery callbacks
It's overly verbose, unintuitive and in 2025, having a virtual dom is no longer compulsory to write interactive web apps. If you want to write modern web apps, you can use Svelte. If you want to write web apps truly functionally, you can use Elm. React is the jQuery of our times. It was really helpful in the Angular era but we are living at the dawn of a new era now.
The problem with React is that it solved frontend.<p>So the options are to 1. Code React all day and be happy with it. 2. Come up with reasons why it's bad.<p>There are many talented and intellectually curious people in the field which lean towards 2.
by 2060 React Native should be up to v0.93
there are already de facto two Reacts. by 2060, there will be five.
Two Reacts!?
The main divide now is client side React versus Server Components usually with a node.js backend
As someone who doesn't use React, there is React Native (for iOS & Android), and React (and that can be server-rendered or client-rendered).
class components & function components.
I love jQuery and it’s elegant methods chaining over object / array of DOM elements you keep in the chain.<p>15+ years ago I wrote a tutorial for french people about using jQuery, it got a lot of views. I hope it helped spread jQuery.
Unbelievably, still supports IE 11 which is scheduled to be deprecated in jQuery 5.0
It looks like it was done to not delay the 4.0 release. Since they follow semvar, that means it won't get the axe until 5.0 [1]. Pretty wild considering that 3.0 was released 10 years ago.<p>But maybe they will scope this one better: they were talking about getting 4.0 released in 2020 back in 2019!<p>[1]: <a href="https://github.com/jquery/jquery/pull/5077" rel="nofollow">https://github.com/jquery/jquery/pull/5077</a>
[2]: <a href="https://github.com/jquery/jquery/issues/4299" rel="nofollow">https://github.com/jquery/jquery/issues/4299</a>
Backwards compatibility. Apparently there are still some people stuck on IE11. It's nice that jQuery still supports those users and the products that they are still running.
This is the part that I find the strangest:<p>> We also dropped support for other very old browsers, including Edge Legacy, iOS versions earlier than the last 3, Firefox versions earlier than the last 2 (aside from Firefox ESR), and Android Browser.<p>Safari from iOS 16, released in 2022, is more modern in every conceivable way than MSIE 11. I'd also bet there are more people stuck with iOS 16- than those who can <i>only</i> use IE 11, except maybe at companies with horrid IT departments, in which case I kind of see this as enabling them to continue to suck.<p>I'd vote to rip the bandaid off. MSIE is dead tech, deader than some of the other browsers they're deprecating. Let it fade into ignomony as soon as possible.
There are a lot of intranet web applications that require IE, and IE is still in support by Microsoft. Even on Windows 11 Edge still has IE Mode for that reason. IPhones stuck on older iOS version by definition aren’t supported by Apple anymore.
“Support” here probably means “we’re testing jQuery for compatibility on those web browsers” - likely Safari from iOS 16 still runs this version of jQuery just fine. However, running automated test suites or support bugfixing for those clients is a lot harder than spinning up some Microsoft-provided VM with IE11 on it.
It’s rarely a horrid IT department but some special or legacy software without modern replacement
> Safari from iOS 16, released in 2022, is more modern in every conceivable way than MSIE 11.<p>There are likely millions if not tens of millions of computers still running MSIE11. There are likely to be no devices running iOS 16
> There are likely to be no devices running iOS 16<p>My iPhone X is stuck on iOS 16 with no way to upgrade.<p>However, the phone is still working well. Despite being in daily use for 8 years it still has 81% battery capacity, has never been dropped, has a great OLED screen, can record 4K@60 video. It is far more responsive than a brand new 2025 $200 Android phone from e.g. Xiaomi. It still gets security patches from Apple. The only real shortcoming compared to a modern iPhone is the low light camera performance. That and some app developers don't support iOS 16 anymore, so e.g. I can't use the ChatGPT app and have to use it via the browser, but the Gemini app works fine.
According to Cloudflare, there are almost no users still on MSIE of any version.[0]<p>Statcounter says there are about 4.6% of iOS users still on iOS 16.[1]<p>My gut instinct is that there are multiple times more people using iOS 16 today than MSIE of any version.<p>[0] <a href="https://radar.cloudflare.com/reports/browser-market-share-2025-q3" rel="nofollow">https://radar.cloudflare.com/reports/browser-market-share-20...</a><p>[1] <a href="https://gs.statcounter.com/os-version-market-share/ios/mobile-tablet/worldwide" rel="nofollow">https://gs.statcounter.com/os-version-market-share/ios/mobil...</a>
I visited a distillery in 2020. Their machines were managed by HP laptops running Windows XP. Those machines and those laptops and that Windows XP are probably still there with their old IE browser.
IIRC public counters tend to miss corporate networks.
Are those people/products upgrading jQuery though?
Who is still stuck on IE 11---and why?
There are some really retrograde government and bigcorps, running ten year old infrastructure. And if that is your customer-base? You do it. Plus I worked on a consumer launch site for something you might remember, and we got the late requirement for IE7 support, because that's what the executives in Japan had. No customers cared, but yeah it worked in IE7.
Oh, certainly, corporations run ten-year-old software. But for the record, IE 11 turns 13 this year [1]. Which makes it somewhat more surprising to me.<p>[1] <a href="https://en.wikipedia.org/wiki/Internet_Explorer_11" rel="nofollow">https://en.wikipedia.org/wiki/Internet_Explorer_11</a>
Some corporate machines still run XP. Why upgrade what works?
I think anything still using ActiveX like stuff or "native" things. Sure, it should all be dead and gone, but some might not be and there is no path forward with any of that AFAIK.
Surely by this point someone has written a 0-day for MSIE 11 which gets root and silently installs an Internet Explorer skinned Chromium. If not, someone should get onto that. —Signed, everyone
Microsoft will support IE 11 until 2032 in Windows 10 LTSC and IE Mode in Edge on Windows 11.
Not everybody in the world can use modern hard- and software.
There are tons of school computer labs running old software
It's amazing how much jQuery is still used today. Even on modern websites you can often find it included (browser devtools -> jQuery in the console, and see). And not just on hobbyist sites, but on serious company websites and their web tools as well.
I cannot express how much I admire the amount of effort jQuery puts into their upgrade tools.
jQuery was very useful when many features were missing or not consistent/standardized between browsers. Nowadays, JS / DOM API is very rich, mature and standardized. So, jQuery is not as necessary as it was before.<p><a href="https://youmightnotneedjquery.com/" rel="nofollow">https://youmightnotneedjquery.com/</a><p>Yes, sometimes the vanilla JS analogs are not the most elegant, but the vast majority are not terribly complicated either.<p>IMHO, another advantage of vanilla JS (aside from saving ~30KB) is potentially easier debugging. For example, I could find / debug the event listeners using the dev tools more easily when they were implemented via vanilla JS, since for complicated event listeners I had to step through a lot of jQuery code.
Everything I ever used jquery for 15 years ago, I found myself able to do with the CSS and the JS standard library maybe 10 years ago. I honestly am confused when I see jquery used today for anything.<p>Is there still anything jquery does you cannot easily do with a couple lines of stdlib?
The terse and chainable jQuery syntax is more readable, easier to remember, and thus more pleasant to maintain. Rewriting for stdlib is easy, but bloats out the code by forcing you to pepper in redundant boilerplate on nearly every line.
Jquery does many things in one line that requires a couple lines of stdlib. Writing less code is what libraries are for.
That changelog is wild; it closes out dozens of issues that have been open on Github for 5+ years. I assume that's related to this being the first new major version in years.<p>Has anyone done any benchmarks yet to see how jQuery 4 compares to jQuery 3.7?
The first time I truly enjoyed web development was when I got the hang of jQuery. Made everything so much simple and usable!
jQuery was peak JavaScript.<p>Good times, I'm glad it is still around.
For us that started doing web apps as soon as the web was invented, JQ was a miracle.<p>Thanks guys!
> includes some breaking changes<p>Most of the changes are completely reasonable - a lot are internal cleanup that would require no code changes on the user side, dropping older browsers, etc.<p>But the fact that there are breaking API changes is the most surprising thing to me. Projects that still use jQuery are going to be mostly legacy projects (I myself have several lying around). Breaking changes means more of an upgrade hassle on something that's already not worth much of an upgrade hassle to begin with. Removing things like `jQuery.isArray` serve only to make the upgrade path harder - the internal jQuery function code could literally just be `Array.isArray`, but at least then you wouldn't be breaking jQuery users' existing code.<p>At some point in the life of projects like these, I feel like they should accept their place in history and stop themselves breaking compatibility with any of the countless thousands (millions!) of their users' projects. Just be a good clean library that one can keep using without having to think about it forever and ever.
I remember being scared of jQuery and then being scared of vanilla JS. My, how time flies.<p>Incredible it's still being maintained.
That bit about focus event order gave me flashbacks and raised my heart rate by a couple of bpm. Had some bad times with that ~15 years ago!
I still love the simplicity a ajax call can be done in Jquery
jQuery is the last time I felt a library doing magic! Nothing has matched the feelings since then.
What is the usecase for this in the age of React, NextJS? And for static sites we have Astro etc.
And even if you need something simple why use jQuery? Vanila JS has better API now. Am I missing anything?
I do a lot of custom JS widget development, games, and utilities that are outside the context of a gigantic framework like React. Not everything is a a full-page SPA. Vanilla JS is indeed better than it was, but I found myself writing small JQ-like libraries and utilities to do tedious or even basic DOM manipulation, so I switched back to JQ and saved myself a lot of time and headaches. Compressed, minified JQ is also pretty small and is negligible in space consumption.<p>JQ is also used in frameworks like Bootstrap (although I think they’re trying to drop third-party dependencies like this since they tend to cause conflicts).<p>I have also used JQ in an Angular app where complex on-the-fly DOM manipulation just isn’t practical with standard tooling.
Hobbyists don’t want to learn every new framework. Someone can have a small business website for their activity and have been happy using jQuery since 2010.
I wish it also included support for XPath Query.
I am still using jQuery.
I love that they support ES6 modules, Trusted Types, and CSP! The clearing out of old APIs that have platform replacements is nice to see too!
I thought this would include more drastic changes, but it seems that this is more house cleaning stuff, like, "nobody should really be using this in 2026". They are providing a library for someone who <i>really</i> likes jQuery and wants to use it over something like React. (Which is completely fine and reasonable.)<p>Looks like the core behavior doesn't change, something that people complain about, e.g. <a href="https://github.blog/engineering/engineering-principles/removing-jquery-from-github-frontend/" rel="nofollow">https://github.blog/engineering/engineering-principles/remov...</a><p>> This syntax is simple to write, but to our standards, doesn’t communicate intent really well. Did the author expect one or more js-widget elements on this page? Also, if we update our page markup and accidentally leave out the js-widget classname, will an exception in the browser inform us that something went wrong? By default, jQuery silently skips the whole expresion when nothing matched the initial selector; but to us, such behavior was a bug rather than a feature.<p>I completely agree with this, because I have been bitten so many times by this from subtle bugs. However I can see some other people not caring about any of it.<p>I already know that I am definitely not going to use jQuery in my personal projects, and there is no chance that my workspace does. (I much prefer letting a framework handle rendering for me based on data binding.) So none of that concerns me. But good luck to jQuery and anyone who sticks with it.
This is huge. jQuery is still my way to go for any website requiring some custom interaction that isn't available in vanilla js.
Hmm maybe i can finally move on from 2.x
Long-time user here. It served me well for years, though I haven't really touched it since the 3.0 days. Glad to see it's still being maintained.
is there any reason to use jquery if you've never used it before
It’s refreshing to see jQuery 4
I used jQuery for the past ~ 10 years on smaller apps and I had no problems with it. Then I slowly replaced it with modern JS wherever possible and I found that today I am using jQuery only because Datatables.js depends on it.<p>It was a nice ride, many thanks to the people that worked and still work on it. Not sure we'll ever see a jQuery 5, but that's life.
I was surprised that for most of my smaller use cases, Zepto.js was a drop-in replacement that worked well. I do need to try the jQuery slim builds, I've never explored that.
still needs more jQuery
[flagged]
No love for $…?
jQuery is v4 now, but a lot of sites esp. wordpress still have 1.11 or 1.12 and only uses them to either doing modals(popover), show/hide(display), or ajax(fetch).
Even after migrating to ES modules, jQuery is still somewhat bloated. It is 27 kB (minified + gzipped) [0]. In comparison, Preact is only 4.7 kB [1].<p>[0]: <a href="https://bundlephobia.com/package/jquery@4.0.0" rel="nofollow">https://bundlephobia.com/package/jquery@4.0.0</a><p>[1]: <a href="https://bundlephobia.com/package/preact@10.28.2" rel="nofollow">https://bundlephobia.com/package/preact@10.28.2</a>
> Preact is only 4.7 kB<p>Is there some outlier place where people using virtual DOM frameworks don't also include 100-200kb of "ecosystem" in addition to the framework?<p>I suppose anything is possible, but I've never actually seen it. I have seen jQuery only sites. You get a lot for ~27kB.
jQuery does a lot more though, and includes support older browsers.
> includes support older browsers<p>Which is entirely the issue. Supporting a browser for the 10 users who will update jQuery in 2025 is insane.
Officially they state they only support 2 latest versions of chrome. But considering their support of IE11, that's actually a lot.