I’m glad to be learning some jQuery, despite all the haters

A lot of people will tell you that jQuery is dead because JavaScript frameworks like React, Angular, Vue, and Ember are far more in favor right now. Those frameworks may be in style right now, but based on my research, jQuery is still used in some form or another on roughly 75% of all websites. I do not have hard data for these numbers, but various sources I have found all put the number somewhere around 75% of all sites, and 95% of sites that use JavaScript. A huge reason for this is that jQuery is that jQuery is part of other libraries, most notably Bootstrap.
We now know that jQuery is pretty far from dead, and is actually used on the vast majority of websites in some form or another. So, how and why did it become so popular? Well, one reason is that it was released before any of the JavaScript frameworks that are considered ‘better’ today, so it was essentially the only game in town. More reasons for jQuery’s success is that it is lightweight, performant, and easy to add to your project. All you have to do is add the jQuery script to the head of your index.html file, and you can start writing jQuery. Perhaps most importantly, it is pretty easy to pick up if you are already comfortable with JavaScript. jQuery adds a lot of functionality to vanilla JS, but doesn’t require you to learn a whole new way of structuring your projects like React does. The only thing you really need to do differently is follow the syntax(which we will get into later). So, why do people hate on it so much? This chart from Wikipedia shows that jQuery can still do basically anything the competition can.

None of this is to say that you should drop your framework of choice. I’m merely suggesting that a lot of the “jQuery is dead” rhetoric you see online is hyperbolic, and you should not outright dismiss using jQuery because other people don’t like it.
Reasons to use jQuery
- Ease of use. As I mentioned earlier, jQuery is incredibly easy to set up, and very easy to pick up if you already know JavaScript.
- Animations and styling. jQuery allows you to programmatically alter styles and create animations, all without needing to touch your CSS. jQuery comes with several built in methods to assist with animations.
- jQuery is tried and true. Since it has been around for over 15 years, you will most likely be able to find documentation or a Stack Overflow post to help you with any roadblocks you hit.
- A lot of sites already use it. This might not be the most convincing reason, but it matters. Since jQuery was the only game in town for a long time, there are millions of websites built with it. If you have to revamp a site that uses jQuery, it is often worth using over other frameworks so that you do not have to completely start over.
Reasons to avoid jQuery
- Vanilla JavaScript has changed drastically(for the better), and is now able to do a lot of the things that jQuery used to do better. For example, a big part of jQuery’s success was that it was much easier to make AJAX requests than with just Vanilla JS. Now, we have the fetch API which essentially does the same thing. One could argue that it is not worth using because of this.
- Cross-browser compatibility has improved dramatically over the years. One of the main advantages to jQuery in the past was that it made it much easier to design a site that would look good and function well on any browser. This is much less of an issue today.
- If you are interested in having a lot of complex UI or making a single-page-application, one of the more modern frameworks is probably a safer bet. jQuery was designed to solve a different set of problems than React or Angular. The shift towards single-page-apps has played a huge role in jQuery’s decreasing popularity.
I think the most compelling reason to avoid jQuery(and the reason so many people insist it is dead) is the first one listed above. jQuery solved a lot of the issues that JavaScript had years ago, and JavaScript has changed to address these issues on it’s own. While I can understand that people would use it less often because of this, I still don’t understand the hate. To me, the fact that JavaScript has been changed to be more like jQuery is proof that jQuery is the single most important JavaScript framework of all time. It was so much better than Vanilla JS that it influenced the direction that JS went in.
Overall, I like jQuery. You can quickly prototype sites and manipulate the DOM with ease. The syntax is closer to vanilla than most other frameworks, and vanilla JS can do a lot of stuff! My personal recommendation would be to use jQuery if you have a lot of animation effects, since it has a lot of powerful functionality built in.