jQuery: JavaScript Library for DOM Manipulation
GitHub Repo
MIT
November 20, 2026 at 01:46 PM
0 views

jQuery: JavaScript Library for DOM Manipulation

@jqueryProject Author

What jQuery is

jQuery is the JavaScript library for DOM work that many existing websites still load: selecting elements, changing them, handling events, running small animations and making Ajax requests, all through one chainable $() API. The npm package describes itself as a "JavaScript library for DOM operations", and the README published inside the package calls it "a fast, small, and feature-rich JavaScript library". The repository README is mostly for contributors. It covers the version support table, building from source, custom builds and the test suite, and sends usage questions to api.jquery.com.

In 2026 the project matters for two reasons. jQuery 4.0.0 shipped in January 2026, the first major release since 3.0 in 2016, and 4.1.0 and 3.8.0 both followed on 17 November 2026. Any team still running jQuery 3.x has a migration to plan, and 4.x has a smaller API, new module entry points and fewer supported browsers. This write-up covers what changed, what was measured in a test run, and when native DOM APIs or a smaller library would do the job instead.

The repository is jquery/jquery, written in JavaScript, created on 3 April 2009 and developed on main. It is MIT-licensed; LICENSE.txt reads "Copyright OpenJS Foundation and other contributors". The README also links paid long-term support for old versions from two vendors, HeroDevs and TuxCare.

Versions and support status

The README's version table lists 4.x on main with "Full" support, 3.x on 3.x-stable as "Critical-only", and 2.x and 1.x as unsupported. SECURITY.md is shorter still: "The latest released version of jQuery is supported." Vulnerabilities go privately to [email protected]. If there is no acknowledgement within 6 business days, reporters may escalate to the OpenJS Foundation CNA. Advisories and CVEs are published through that CNA.

The npm registry showed this release history on 20 November 2026:

VersionPublished to npm (UTC)Dist-tag on 20 Nov 2026
3.7.128 August 2023
4.0.0-beta6 February 2024
4.0.0-rc.111 August 2025
4.0.0-rc.218 January 2026, 00:20beta
4.0.018 January 2026, 00:28
3.8.017 November 2026, 16:51v3-latest
4.1.017 November 2026, 19:02latest

The registry lists 67 published versions, going back to the package's creation in March 2011. The beta tag still points at a 4.0 release candidate. The 4.1.0 changelog in the repository opens with a link to a blog post titled "jQuery 4.1.0 and 3.8.0 released: passing the torch". That post was not reachable from the test environment, so this page relies on the changelog files. For 4.1.0 they list an Ajax responseURL field on jqXHR, a ReDoS fix in selector identifier matching, use of querySelectorAll instead of getElementsBy{Tag,Class}Name, createElementNS for CSS work in XML documents, and serialization of form-associated custom elements. The 4.1.0 docs section also adds guidelines for machine-generated contributions. The 3.8.0 changelog on 3.x-stable lists support for the until-found value of the hidden attribute and formally deprecates the push/sort/splice methods that 4.0 removed.

How jQuery 4 is packaged

From 4.0 on, the source is written as ES modules instead of AMD. The package.json has "type": "module" and an exports map with four entry points: ., ./slim, ./factory and ./factory-slim. A fifth pattern, ./src/*.js, exposes individual source modules. Each entry point resolves differently for Node import, Node require, bundlers and plain ESM. Builds come in a few flavours:

  • Full build (dist/jquery.js, UMD): everything, including ajax, deferred, callbacks, effects and queue.
  • Slim build (jquery.slim.js): the published README says it excludes "the ajax, callbacks, deferred, effects & queue modules". In 3.x the slim build still kept Deferred, Callbacks and queues; the 4.0 upgrade guide lists their removal as a slim-only breaking change.
  • ES module builds (dist-module/jquery.module.js and its slim twin) export named $ and jQuery plus a default export. The README recommends named imports "for better interoperability across tooling".
  • Factory builds (jquery/factory, jquery/factory-slim) export a function that takes a window. They are meant for jsdom and other environments with no global window.
  • Custom builds: the repository build script can exclude any module except core. Excluding selector swaps the full engine for a small wrapper around querySelectorAll that drops jQuery's selector extensions. The README warns that "Non-official custom builds are not regularly tested."

The two wrappers in the package show how the dual-format problem was handled. dist-module/wrappers/jquery.node-module-wrapper.js, used for Node import, imports the CommonJS dist/jquery.js and re-exports it. dist/wrappers/jquery.bundler-require-wrapper.js, used for bundler require, goes the other way and requires the ES module. In both cases each environment ends up with a single instance of jQuery. The ESM and CJS test below confirms this for Node.

Supported browsers, per the 4.0 upgrade guide, are Internet Explorer 11 only, the current and previous versions of Chrome, Edge, Firefox and Safari, current Opera, the last three iOS Safari versions and the last two Android versions. IE 10 and older and legacy (non-Chromium) Edge are dropped, and the guide says this list will not change until 5.0.

Getting started

From npm, per the published package README:

npm install jquery
import { $ } from "jquery";

In a CommonJS file:

const $ = require( "jquery" );

The same README notes that "The CommonJS module does not expose named $ & jQuery exports". For Node with jsdom, it documents the factory entry point:

import { JSDOM } from "jsdom";
const { window } = new JSDOM( "" );
import { jQueryFactory } from "jquery/factory";
const $ = jQueryFactory( window );

For an upgrade, the jQuery Migrate README loads the plugin straight after jQuery. Its example still names 4.0.0:

<script src="https://code.jquery.com/jquery-4.0.0.js"></script>
<script src="https://code.jquery.com/jquery-migrate-4.0.2.js"></script>

To build from a clone of the repository, the README gives npm run build for the default file and this command for every release variant:

npm run build:all

Two of its custom-build examples, one reproducing the official slim build and one dropping Ajax:

npm run build -- --filename=jquery.slim.js --slim
npm run build -- --exclude=ajax

Hands-on: jQuery 4.1.0 against 3.8.0 and 3.7.1

Everything in this section was run on 20 November 2026 in a cloud VM: Ubuntu 24.04.5 LTS, Linux x86_64, 2 vCPUs, about 7.8 GiB RAM, Node.js 22.23.5 and npm 10.9.9. The DOM came from jsdom 31.0.1 installed from npm. Each jQuery version went into an empty project with npm install jquery@<version>. Gzip sizes come from zlib level 9, so they will differ slightly from a CDN's compression. Timings are from one machine running jsdom, not a browser. Treat them as rough indications only.

Install footprint and file sizes

Measure4.1.03.8.03.7.1
Runtime dependencies000
Unpacked package size2,922,652 bytes, 165 files1,266,032 bytes, 126 files1,246,374 bytes, 125 files
jquery.js (unminified)259,071 B288,757 B285,314 B
jquery.min.js78,965 B / 27,693 B gzip88,176 B / 30,728 B gzip87,533 B / 30,451 B gzip
jquery.slim.min.js56,030 B / 19,531 B gzip70,784 B / 24,356 B gzip70,264 B / 24,132 B gzip
jquery.module.min.js (ESM)78,877 B / 27,683 B gzipnot shippednot shipped
jquery.slim.module.min.js (ESM)55,942 B / 19,522 B gzipnot shippednot shipped

Compared with 3.8.0, the 4.1.0 minified full build is 10.4% smaller (9.9% after gzip) and the slim build is 20.8% smaller (19.8% after gzip). Part of the slim saving comes from Deferred, Callbacks and queue leaving that build. The npm package itself is 2.3 times larger on disk. It now ships a dist-module/ directory (1,303,856 bytes) next to dist/ (1,304,313 bytes, including factory builds and source maps), plus 137 source files under src/. That size matters for node_modules and Docker layers, not for what reaches the browser.

API surface and evaluation time

Each minified file was evaluated in a fresh jsdom window, in a separate Node process per file, 41 times. This was done three times. The table gives the range across the three runs:

BuildFirst evaluationMedian evaluationOwn keys on jQueryMethods on jQuery.fn
3.7.1 min36.5–42.3 ms5.5–6.7 ms94143
3.8.0 min36.4–40.0 ms5.0–6.7 ms94143
3.8.0 slim.min37.6–54.5 ms5.5–7.4 ms75126
4.1.0 min13.6–20.2 ms1.7–2.5 ms81140
4.1.0 slim.min11.0–14.7 ms1.3 ms55118

In jsdom, 4.1.0 evaluated in roughly a third to half the time of the 3.x builds. Whether a real browser shows the same gap was not tested. In the 4.1.0 slim build, $.ajax, $.Deferred, $.Callbacks, .queue() and .animate() were all undefined. The 3.8.0 slim build lacked only Ajax and effects.

Removed APIs, verified by calling them

The upgrade guide lists 13 deprecated APIs removed in 4.0, among them jQuery.fx.interval. Checking typeof on each in jsdom against all three versions confirmed every removal:

API3.7.1 / 3.8.04.1.0Replacement named in the guide
$.isArray, $.trim, $.parseJSON, $.nowfunctionundefinedArray.isArray, String.prototype.trim, JSON.parse, Date.now()
$.isFunction, $.isNumeric, $.isWindow, $.typefunctionundefinedtypeof, Number.isFinite, an explicit window check
$.camelCase, $.nodeName, $.uniquefunctionundefined(internal), nodeName.toLowerCase(), $.uniqueSort
$.cssPropsobjectundefinednot needed in supported browsers
$.fx.interval13undefinednot needed with requestAnimationFrame
$.fn.push, .sort, .splicefunctionundefinedundocumented; removed

$.proxy, $.holdReady, $.isPlainObject and $.uniqueSort were still present in 4.1.0.

Behaviour changes observed

Call3.7.1 / 3.8.04.1.0
.css("gap", 10)gap: 10pxno style written (unitless 10 is invalid for gap)
.css(prop, 10) for font-size, column-gap, flex-basis, letter-spacing, border-radius, outline-width, text-indentnot tested individuallyno style written
.css(prop, 10) for width, height, top, margin-top, padding, border-width, max-width, min-height10px10px
.css("line-height", 2)line-height: 2line-height: 2
$('<p class="m n">').toggleClass(false)class becomes ""class stays "m n"
.css("opacity") on a detached element"1"""

In the 4.1.0 source, automatic px comes from one regular expression, rautoPx, which matches border widths, margins, paddings, top/right/bottom/left and the (min/max) width and height properties. Everything else is passed through as given. The table shows the danger: font-size and gap fail silently, with no error thrown and nothing written to the style attribute.

Module loading in Node 22

ScenarioObserved
3.8.0: require("jquery") with no global windowreturns a factory function; calling it with a jsdom window gives 3.8.0
4.1.0: require("jquery") with no global windowthrows Error: jQuery requires a window with a document
4.1.0: import("jquery") with no global windowthrows the same error
4.1.0: require("jquery/factory").jQueryFactory(window)works; $.fn.jquery is 4.1.0
4.1.0: require("jquery/factory")(window), the form in the upgrade guidefails: the module is an object whose only key is jQueryFactory, not a function (same in 4.0.0)
4.1.0: ESM import("jquery/factory")exports default and jQueryFactory
4.1.0: globalThis.window set to a jsdom window before require("jquery")works; window.$ and window.jQuery are not set
4.1.0: ESM import with a global windowexports $, jQuery and default, all the same function; createRequire then require("jquery") returns that same instance
4.1.0: jquery/factory-slim$.fn.jquery reports 4.1.0+slim

jQuery Migrate 4.0.2

The development build of jQuery Migrate 4.0.2 was loaded after dist/jquery.js 4.1.0 in jsdom. The test then called removed APIs and the changed signatures:

  • Removed utilities were restored and worked: $.isArray([1]) returned true, $.trim(" x ") returned "x", $.type([]) returned "array", and $.fn.push was a function again. Each logged a warning such as JQMIGRATE: jQuery.isArray() is removed; use Array.isArray(). The jQuery.migrateMessages array collected them with patch codes like [isArray] and [toggleClass-bool].
  • toggleClass(false) behaved the old way under Migrate, clearing the class, and logged [toggleClass-bool].
  • .css("gap", 10), .css("column-gap", 7) and .css("flex-basis", 30) each logged [css-number], but none was written to the element. Migrate flagged the call without restoring the old px behaviour, so the styling bug remains with the plugin loaded.
  • A test document without a doctype produced JQMIGRATE: jQuery is not compatible with Quirks Mode [quirks], which can catch legacy templates.
  • The minified Migrate build printed one line, JQMIGRATE: Migrate is installed, version 4.0.2, and no warnings, as its README says. It still filled migrateMessages, so the messages can be read programmatically in production.

Migrate's own size from the npm package: 33,330 bytes for the development build and 13,811 bytes minified.

A few tasks against native APIs

Native code and jQuery gave the same results in jsdom for class changes on 1,000 list items, delegated clicks (2,001 handler runs each) and :even compared with :nth-child(odd) (500 matches each). One output differed. For an input holding a b, $("#f").serialize() produced q=a%20b&n=5&s=x, while new URLSearchParams(new FormData(form)).toString() produced q=a+b&n=5&s=x. Servers normally decode both the same way, but a test or cache key that compares strings will see a difference when code moves off jQuery. No timing comparison is given for these tasks: jsdom implements the DOM in JavaScript, so its speed ratios do not carry over to browsers.

Use cases

  • Maintaining server-rendered sites and CMS themes that already depend on jQuery and its plugins. 4.x is the version with full support, and the upgrade guide says jQuery 4.0.0 works with jQuery UI 1.13.3 or newer.
  • Progressive enhancement on pages where a few dozen lines of event handling and DOM changes do not justify a component framework.
  • Testing and scraping in Node with jsdom, using the jquery/factory entry point. The repository runs its own jsdom smoke tests (test:jsdom, test:bundlers in package.json).
  • Size-sensitive pages that keep the jQuery API: the 4.1.0 slim ESM build, at about 19.5 KB gzipped, with fetch and native promises replacing $.ajax and Deferreds.
  • Gradual removal: the src/*.js entry points let code import just css.js or event.js. The README says this interface is not stable "even between minor or patch releases".

How it compares

The alternatives below were checked from their READMEs and npm metadata on 20 November 2026. Sizes are minified files from each npm package, gzipped the same way as the jQuery files above.

jQuery 4.1.0Cash 8.1.5Umbrella JS 3.3.4Alpine.js 3.17.5htmx 2.0.11
ModelImperative DOM, events, Ajax, effects"jQuery-style syntax for manipulating the DOM"DOM traversal, editing and eventsDeclarative x-data/x-on attributes with reactive stateHTML attributes (hx-post, hx-swap) that trigger requests and swap in server HTML
Licence (npm)MITMITMITMIT0BSD
Min file / gzip, measured78,965 / 27,693 B (slim 56,030 / 19,531 B)16,923 / 6,264 B8,288 / 2,623 B55,935 / 19,998 B (cdn.min.js)52,182 / 16,944 B
Size claim in READMEnone16 KB min, 6 KB gzip"<3kb"none"~14k min.gz'd"
Built-in AjaxYes ($.ajax; not in slim)No $.ajax in the testREADME mentions an ajax exportNoCore purpose
Runtime dependencies000@vue/reactivity0
Latest npm release17 Nov 202613 Apr 202324 Oct 202620 Oct 202622 Sep 2026
  • Native DOM now covers most of what jQuery was first used for: querySelectorAll, classList, closest(), fetch and FormData. The 4.0 upgrade guide's replacement list points to native APIs throughout. What jQuery still adds is implicit iteration over sets, its selector extensions (:even, :visible), namespaced events, .data() and a large plugin ecosystem.
  • Cash says "100% feature parity with jQuery isn't a goal, but Cash comes helpfully close", and it offers partial builds and a migration guide. In jsdom it behaved like jQuery 3 rather than 4 on two of the checks above. .css("gap", 10) wrote gap: 10px, and $.isArray exists. Its README comparison table is measured against jQuery Slim 3.4.1. The npm package has not had a release since April 2023.
  • Umbrella JS is the smallest option measured, at 2,623 bytes gzipped. Its README links a "Migrating from jQuery" guide. Its serialize() encoded the space as +, like URLSearchParams and unlike jQuery.
  • Alpine.js is a different model: behaviour is declared in markup with reactive state, so it replaces hand-written DOM updates rather than offering a jQuery-like API. Its npm package depends on @vue/reactivity, the reactivity package from Vue core.
  • htmx replaces the $.ajax-plus-.html() pattern with attributes that fetch HTML from the server. At 16,944 bytes gzipped, the measured size was higher than the README's "~14k" figure, which may use different compression.

For applications that keep state on the client, a component framework such as Svelte or Vue fits better than any library in the table. A promise-based client such as Axios or plain fetch covers what $.ajax did.

Limits, trade-offs and when not to use it

  • Silent CSS breakage on upgrade. This is the riskiest change found in testing. Numeric values for font-size, gap, flex-basis, border-radius and similar properties are dropped without any error in 4.x. Migrate warns about them but does not restore the old behaviour. Search the codebase for .css( and .animate( calls that pass numbers.
  • Node setups need changes. Code that relied on 3.x returning a factory from require("jquery") throws in 4.x. Use jquery/factory and its named jQueryFactory export.
  • Slim means slimmer than before. Code that used $.Deferred, $.when or .queue() with the 3.x slim build must switch to the full build or native promises.
  • A bigger node_modules footprint. The npm package grew from 1.27 MB to 2.92 MB unpacked, even though the files a browser downloads got smaller.
  • Old browsers. IE 10 and below, legacy Edge and older mobile browsers are unsupported. The 3.x line is "critical-only", so sites that need those browsers stay on 3.8.0 or pay for extended support.
  • Plugins are the long tail. Many plugins call removed APIs such as $.isFunction, $.trim and $.fn.push. Migrate restores these, but the upgrade guide calls production use of Migrate ideally "a short-term solution" and says running multiple versions of Migrate at once is not supported.
  • When not to use it. For a new single-page application, a component framework with a bundler such as Vite is the more usual choice. For a few event handlers on a modern-only site, native APIs avoid shipping roughly 19.5–27.7 KB gzipped. Measure the real cost with Lighthouse rather than guessing.
  • jsdom is not a browser. All results here came from jsdom. Layout-dependent methods (.width(), .offset(), animations) need real-browser testing, for example with Playwright.

Discrepancies between documentation and observed behaviour

  • The 4.0 upgrade guide shows const jQuery = require( "jquery/factory" )( window );. In both 4.0.0 and 4.1.0, require("jquery/factory") returned an object, { jQueryFactory }, so that line fails with a "not a function" error. The package README's form, jQueryFactory( window ), is the one that works.
  • Migrate's warnings.md says jQuery "currently treats" $.css("line-height", 2) "as "2px"". In 3.7.1, 3.8.0 and 4.1.0 alike, that call wrote a unitless line-height: 2.
  • The Migrate README says the plugin works "by restoring the APIs that were removed". That held for removed functions, but the [css-number] patch only warned and did not bring back px appending.
  • The jQuery Migrate README still links the 4.0.0 release-candidate blog post from August 2025, and its usage example loads jquery-4.0.0.js. The repository README still headlines "jQuery 4.0.0 has been released!" while npm's latest is 4.1.0, and the npm beta tag still points at 4.0.0-rc.2.
  • Cash's README comparison is against jQuery Slim 3.4.1 at 71 KB minified and 24.4 KB gzipped. The 4.1.0 slim build measured 56,030 bytes and 19,531 bytes gzipped, so Cash's headline size gap is smaller against current jQuery.

Project activity

Checked 20 November 2026: latest release 4.1.0, published 17 November 2026 (npm latest; GitHub release tag 4.1.0), with 3.8.0 published the same day as v3-latest, per the npm registry. Licence MIT. The jquery/jquery repository had about 60,100 stars (60,103 at the time of writing) and 20,714 forks. It was created on 3 April 2009, is written in JavaScript and was last pushed on 17 November 2026. Changes are listed in the changelog, and breaking changes in the 4.0 upgrade guide source. According to CONTRIBUTING.md, pull requests require signing a Contributor License Agreement, and the core team meets weekly on Mondays in a Matrix channel. The homepage is jquery.com, and the API documentation is at api.jquery.com.

Enjoying this project?

Discover more amazing open-source projects on TechLogHub. We curate the best developer tools and projects.

Project
jquery
Created
November 20
Last Updated
November 20, 2026 at 01:46 PM

Maintain jQuery: JavaScript Library for DOM Manipulation? Add the badge to your README

Show that the project is featured on TechLogHub and send readers to this write-up.

Featured on TechLogHub
[![Featured on TechLogHub](https://techloghub.com/badge-neutral.svg)](https://techloghub.com/open-source/jquery?utm_source=techloghub_badge&utm_medium=referral&utm_campaign=readme)

Find more projects like this

One email a week: new and trending developer tools, fresh comparisons, and what shipped. Unsubscribe in one click.