Does it make sense to learn jQuery in 2024?

João Paixão
MCTW_TDW
Published in
7 min readFeb 27, 2024

Over the last few years, with the emergence and improvement of new web technologies, jQuery’s popularity has been declining, according to data from Stack Overflow’s annual survey. Does it still make sense to learn jQuery? Or should we shift our focus to other technologies?

To put it in context, for those who aren’t familiar with this technology, jQuery is a JavaScript library created in 2006 that makes it easier to manipulate the DOM, manage events, use AJAX and much more.

Given the advantages of using jQuery, why am I asking this question?

Firstly, it’s important to note that many of the features that popularised the use of jQuery are now integrated into the browsers’ own APIs, without the need to use jQuery.

This means that jQuery ended up being a victim of its own success, innovating in such a way that browsers began to integrate these functionalities. Considering that the main browser manufacturers collaborate with each other in order to improve web standards, this integration was transversal to the main browsers.

Different browsers’ support of the addEventListener() method, which replaces jQuery. Source: caniuse.com

The number of actions that jQuery has made consistent in different browsers that are now integrated into browser APIs are too many to list. In fact, there’s even a page, titled “You might not need jQuery”, dedicated solely to showing alternatives to jQuery functionalities that don’t require dependencies.

Example of replacing the click event as shown on the page. Source: https://youmightnotneedjquery.com/

To illustrate, I’m going to demonstrate a very important jQuery feature that can now be realised in native JavaScript, i.e. without the need for any dependencies. In this demonstration, I’m just going to switch the class of a paragraph using a button.

jQuery — Toggle between the class “text_red” in a paragraph
Native JavaScript — Toggle between the class “text_red” in a paragraph

As we can see, the way native JavaScript methods work is identical to jQuery, with only the syntax changing, making it easier to transition from jQuery methods to JavaScript.

Assuming a developer chooses to replace jQuery with native JavaScript functionality, what’s in it for them?

You have to bear in mind that, like all dependencies, jQuery has additional weight in your project. Although it’s only a few KBs, depending on the version, when multiplied by all the pages, it accumulates unnecessary weight that has an impact, albeit small, on performance. This weight is exacerbated by the number of pages included in the project and the capacity of the device used.

You’re probably wondering how much difference a few KBs makes to the project, given that there are usually several images uploaded with much larger sizes. This is a valid question, but you have to bear in mind that the browser treats this type of data very differently.

Images do not block the rendering of the page, which means that the rest of the page is rendered while it is still loading. In contrast to this behaviour, JavaScript blocks rendering when encountered by the browser, only resuming after a process of downloading, decompressing, analysing and executing the JavaScript code.

Example of JavaScript render-blocking

In other words, despite being a lightweight library, especially when minified, jQuery can easily be replaced by native JavaScript, improving performance and eliminating the need to learn another syntax.

jQuery’s popularity

It’s also important to analyse the statistics and, according to Stack Overflow’s annual survey, in the category involving web technologies and frameworks, jQuery has seen a rapid fall in popularity.

In the recent year 2020, of all respondents, i.e. encompassing both professional and recreational developers as well as students, the most widely used complementary web technology was jQuery, with 43.3 per cent of the 42,279 respondents stating that they’ve used this technology.

In 2023, in the same category, jQuery was relegated to third place, with only 21.98 per cent of respondents claiming to use this technology.

Comparison between the use of jQuery and React. Source: Stack Overflow Developer Survey

However, more significant than this result is the category of programming students, which reveals that only 15.4 per cent of learning developers are learning jQuery.

Compared to 42.44% for Node.js or 36.66% for React, it’s possible to say that in 2023, learning developers are prioritising other technologies and leaving jQuery behind.

On the other hand, data from the World Wide Web Technology Surveys, dated December 2023, shows that 94.5 per cent of web pages whose JavaScript library is known to W3Techs use jQuery, which represents 77.3 per cent of all web pages.

It’s important to note that many technologies include jQuery by default, as is the case with the WordPress platform, strongly influencing the percentage of use. However, other technologies are no longer relying on jQuery, such as Bootstrap, which in version 5 made the transition from jQuery to native JavaScript.6

By interpreting the statistics, it’s safe to say that jQuery is being overtaken by technologies such as Node.js, React and even replaced by native JavaScript, while still being used on the vast majority of pages.

Now that we understand what jQuery is, how it differs, the impact it has on projects, the trend in its use today and its global use, how can we answer the initial question?

The answer is simple: it depends on the project!

For a developer looking to develop modern web pages using the latest technologies such as React or Next.js, learning jQuery doesn’t make sense, since native JavaScript replaces the use of jQuery in most of its functionalities. In addition, new technologies also address issues such as data access and manipulation in a very different way, as is the case with Next.js, transcending the need to use jQuery.

However, for a developer who wants to work on older projects, learning jQuery is essential. This is because, due to its former popularity, jQuery is present on many pages that have not yet made the transition to native JavaScript.

It should be noted that the use of jQuery is very similar to modern native JavaScript functions, meaning that learning jQuery after knowing how to manipulate the DOM in JavaScript, for example, won’t be a challenge. The logic remains practically intact, only the syntax changes.

When faced with this decision, ask yourself what kind of projects you want to develop and, if you’re just starting out in the development field, prioritise getting to grips with JavaScript so that you can move on to frameworks such as React or Angular, which you can expect to be used more in the future.

In conclusion, we realise that jQuery is being used less and less, especially by new developers, as a result of the updating of native JavaScript and the new technologies that are emerging. Despite this, learning jQuery remains important for those who need to work on older projects.

References

--

--