EMZETT.
Login

jQuery

In short: An older, widely used JavaScript library that simplified DOM manipulation, events and AJAX requests — today largely replaced by native browser APIs and modern frameworks.

In more detail: jQuery emerged in 2006, when browser APIs were still strongly inconsistent, and offered a unified, compact syntax ($(".class").hide()) for things that are now just as easy to do in vanilla JavaScript. Many older websites and WordPress plugins still depend on jQuery today.

In Depth

Syntax comparison

// jQuery
$(".button").on("click", function () {
  $(this).hide();
});
$.ajax({
  url: "/api/data",
  success: (data) => console.log(data),
});
 
// Modern vanilla JavaScript, same result
document.querySelectorAll(".button").forEach((btn) => {
  btn.addEventListener("click", () => (btn.style.display = "none"));
});
fetch("/api/data")
  .then((res) => res.json())
  .then((data) => console.log(data));

Why jQuery came about at all

jQuery’s historical value lay in hiding cross-browser inconsistencies: in the 2000s, Internet Explorer, Firefox, Safari and other browsers differed considerably in how DOM manipulation, event handling or AJAX requests (asynchronous data requests without reloading the page) technically worked — the same code could run flawlessly in one browser and fail in another. jQuery offered a unified, compact API that internally evened out all these differences, so developers no longer had to worry about browser quirks. The name “jQuery” comes from its central $() function, which “queries” elements via a CSS-like selector.

The rise and gradual replacement

At its peak (roughly 2008-2015), jQuery was installed on a large share of all websites on the web — hardly any website did without jQuery. Since then, web standards have converged considerably: modern browser APIs (querySelector/querySelectorAll, fetch, addEventListener, CSS class manipulation via classList) now cover most of jQuery’s former use cases natively and without an additional library. At the same time, web development overall shifted towards component-based frameworks (React, Vue, Angular), which approach DOM manipulation fundamentally differently (declarative instead of imperative) and structurally make jQuery’s approach unnecessary.

Continuing relevance

Nevertheless, jQuery lives on in large amounts of existing software: many WordPress themes and plugins (WordPress itself still ships jQuery by default), older enterprise web applications, and legacy codebases were never migrated, because a complete rewrite would be risky, expensive and time-consuming, while the existing jQuery code keeps working reliably. For maintenance projects on such legacy systems, basic knowledge of jQuery syntax therefore remains practically relevant, even though no one deliberately starts new projects with it any more.

See also: JS, HTML