jQuery used to be THE library for DOM manipulation, but now it is no match for the view libraries and frameworks that have been put into business by Facebook and Google. Is it still a library worth learning? As much as I know, most of the things jQuery does can do can now be simply done using the new ES6 APIs.
jQuery isn't suited to SPAs (pick any of the awesome FE frameworks for that) but on a normal request/response site, it will get you up and running in no time. Make a table sortable in a one line; what's not to love?
It's also AMAZING for hacking! Let's say I'm on a site and I want to strip out some text, or update something to show a client or colleague something. If jQuery is in the page (or I load it using a Favelet) I can quickly rattle out a one-liner in the console to trawl the DOM and update or scrape.
It's not that you don't get that with ES6 / React / Angular, it's that (the DOM part of) jQuery is all about moving around the DOM and treating elements as chained collections. It's just another paradigm and an incredibly useful one at that.
My only advice would be that as it's so powerful, it's tempting to use it as a crutch, especially when the latest browsers much more powerful selectors and and are generally standardised. If you have jQuery, it's still way quicker to write a one liner than it is to write 10 lines of looping vanilla JS.
Don't let the haters drag you down. Use both as appropriate.
To me it's not something you should learn in the first place apart from just enough to turn the garbage people make with it into something useful and lighter weight. It sure as shine-ola has no business EVER being used on websites due to it's bloat, ineptitude, and ACTIVE promotion of bad methodology... like using the equivalent to querySelectorAll every bloody time you access ANY element, daisy-chaining method calls for massive memory bloat, and slopping content into pages innerHTML style instead of using the DOM.
That last one being part of what makes me wonder just what the **** people are flapping their gums about when they talk about jQuery as being a tool for working with the DOM, as to be brutally frank it side-steps learning how to use the DOM, how to walk it, how to leverage it for lower overhead, or to build directly upon it!!!
ANYONE calling it a "DOM Manipulation" tool doesn't know enough about HTML, CSS, JavaScript, or the huffing DOM to be talking about it! -- no offense, but someone's been blowing smoke up your backside.
But then, the folks who advocate the use of jQuery have generally been pumped so full of smoke rectally, I could chop them into small bits, put those bits in a styrofoam tray, and win a BBQ competition. Hmm. That would make great lyrics for a Cannibal Corpse song...
As I've said hundreds (thousands?!?) of times, EVERYTHING I've ever seen done with jQuery falls into at least ONE of these categories:
1) Stuff that would be less code without the framework -- NOT counting the size of the framework against that total.
2) Stuff that's either HTML or CSS' job.
3) Stuff that has ZERO DAMNED BUSINESS ON A WEBSITE IN THE FIRST PLACE!!!
It is a tool for the nubes, rubes, and fools easily duped by "ooh shiny" and echo-chamber lies, all because they don't know enough about the underlying languages to even be building websites in the first place -- at least not if you care in the slightest about separation of concerns, progressive enhancement, graceful degradation, or JOE FORBID accessibility!
I asked myself the same thing the other day.
I tried to write some vanilla JS for a simple function, and discovered it wasn't cross-browser or mobile compatible -- and if I'd coded it in JQuery, it would have been.
JQuery still has a lot of practical uses for quick projects until we see wider adoption of new technologies (and the abandonment of old hardware limitations).
I think jQuery being so easy to learn and use, you won't spent a lot of time learn it in comparison with React or Angular. Try it for fun one free afternoon or evening, it will be a nice to have. If you don't learn it I don't think it will be the end of the world but a LOT of websites used and are still using jQuery. You'll never know when you are going to encounter with a project that use jQuery
I personally feel that jQuery is something you should work with, at least once.
There are numerous code bases that you'll run into that still use jQuery in some form, so some prior experience with it kind of helps ease into any place. ๐
Not to mention that the reason jQuery became popular in the first place is that it made DOM manipulation easier for people. So if this question is from a what-should-I-pick-up-as-a-beginner point of view, jQuery's still got it's value. ๐
That being said, I never use jQuery in my day-to-day work and even if I have the opportunity to drop a $() in my code, I choose to go the vanilla JS route.
I use this a reference: youmightnotneedjquery.com
jQuery still has its uses. There are better more efficient ways of achieving results, but it all depends on the ecosystem you're developing in/for. Focus on JS, and the jQ API docs will help you out where/when/if you need to work on something in jQ.
Some relevant answers at hashnode.com/post/should-i-learn-reactjs-or-jquerโฆ and hashnode.com/post/in-the-era-of-es5-and-es6-wouldโฆ
But the tldr: learn ES6/vanilla js first; and then if you need to work on legacy systems that use jQuery you'll end up learning that as well. But be aware both are standard DOM and quite different from the "virtual DOM" of, say, React.
Bhojendra Rauniyar
Software Engineer
Normal sites and/or CMS/site builders still use jQuery. Notice that bootstrap still depends on jQuery. Thus, it will be a matter on which you're working on.
Even though, you will be working on frontend libraries like react, you may still use jQuery for some reason. Like I used its hook for customizing bootstrap modal.