Is Everything Alright With jQuery?

Is jQuery dying, or is it here to stay?

Cagri Ozarpaci
Coding in Simple English
2 min readJul 15, 2020

--

Photo by Greg Rakozy on Unsplash

Lately, I’ve seen a lot of blog posts about jQuery allegedly dying out. For anyone who just started their journey in web development, whether jQuery should be considered useful may a bit of a mystery.

To decide if jQuery is useful or not, we should be looking into its use cases:

  • web animations
  • AJAX technology
  • browser games

Mostly, we see jQuery being used for web animations, including mobile menus, dropdown menus, scroll animations, and so on.

When you compare vanilla JavaScript to jQuery for these purposes, jQuery is the most powerful thing that you can use — and it ends up saving you plenty of time.

One significant advantage of using jQuery is that it’s effortless to set up:

And that’s it! You’re ready to go.

Now, let’s evaluate the efficiency of jQuery in practice.

Selecting An Element From DOM:

In vanilla JavaScript, you need to do the following to select an element from DOM:

If we use jQuery instead:

Adding Styles:

In JavaScript:

In jQuery:

Notice that in jQuery, you are using a CSS-like syntax, whereas in vanilla JavaScript, you’re redefining a property.

Event Handling:

Let’s consider a click event. (You may replace this with any other event handler. The official jQuery documentation goes into more detail.)

In JavaScript:

In jQuery:

Now, imagine these types of shortcuts in your whole vanilla JS code.

Carousels and other types of packages arewritten in jQuery as well. In addition, jQuery involves methods that don’t even exist in Vanilla JS that prevent the use of extra CSS, such as fadeIn(), fadeOut(), hide(), show(), and so on.

So what?

I’ve used jQuery in almost all of the websites that I’ve created. Why? It’s easy and it’s fast. jQuery was created for the sake of making web animations and things like that much more quickly, and it lives up this.

In this manner, jQuery is not going anywhere. Unless the web development market completely dies out, jQuery will remain an industry standard.

--

--

Cagri Ozarpaci
Coding in Simple English

designer / developer / writer. A regular non-average guy who is passionate about tech, AI & blockchain