jquery, umbrellajs, and zepto are JavaScript libraries that simplify DOM manipulation, event handling, and AJAX requests using a chainable, jQuery-inspired syntax. jquery is the original, fully-featured library with broad browser support. umbrellajs is a modern, minimal alternative targeting evergreen browsers with a focus on small size and native API usage. zepto was designed as a lightweight jQuery substitute for mobile WebKit browsers but is now unmaintained and should be avoided in new projects.
When you need to work with the DOM in JavaScript, especially in environments where you can’t rely on modern browser APIs alone, lightweight libraries like jquery, umbrellajs, and zepto offer a familiar abstraction layer. All three provide a jQuery-like API for selecting elements, handling events, and manipulating the DOM — but they differ significantly in scope, maintenance status, and compatibility. Let’s compare them head-to-head from an architectural standpoint.
jquery is the original and most widely adopted DOM manipulation library. It was built to smooth over inconsistencies across browsers (especially IE6–IE11) and provides a rich, battle-tested API that works everywhere — including legacy environments.
// jquery: universal DOM manipulation
$('.button').on('click', function() {
$(this).addClass('active');
});
umbrellajs is a modern, minimal alternative focused on ES6+ environments. It avoids legacy browser support entirely and uses native DOM APIs under the hood, resulting in a much smaller footprint while retaining a jQuery-style syntax.
// umbrellajs: modern and lean
u('.button').on('click', el => {
u(el).addClass('active');
});
zepto was designed as a “jQuery-compatible” library specifically for modern mobile browsers (iOS Safari, Android Browser). It drops support for older desktop browsers to stay small, but its development has stalled.
// zepto: mobile-first jQuery subset
$('.button').on('click', function() {
$(this).addClass('active');
});
⚠️ Critical Note: As of 2024,
zeptois effectively unmaintained. Its GitHub repository shows no significant activity since 2020, and it lacks support for modern JavaScript tooling (e.g., proper ESM exports). Do not use Zepto in new projects.
jquery supports all browsers back to IE9 (in version 3.x) and even IE6–IE8 with version 1.x or 2.x. This makes it the only viable choice if you must support legacy enterprise environments.
umbrellajs targets evergreen browsers only (Chrome, Firefox, Safari, Edge ≥79). It assumes querySelector, classList, fetch, and other modern APIs are available. No polyfills are included.
zepto was built for WebKit-based mobile browsers circa 2011–2015. It fails in many modern contexts due to reliance on outdated assumptions (e.g., missing dataset support, broken event delegation in newer Safari versions).
If your project runs exclusively in modern browsers (e.g., Electron apps, internal tools, or mobile web with controlled environments), umbrellajs is safe. For anything requiring broad compatibility — including government or banking systems still on IE11 — only jquery remains practical.
jquery offers a full suite of features:
$.ajax, $.get, $.post)$.Deferred)fadeIn, slideUp)$.each, $.extend, $.proxy)// jquery: full-featured AJAX
$.get('/api/data').then(data => {
$('#content').html(data);
});
umbrellajs focuses only on DOM selection, traversal, and manipulation. It includes basic event handling and class/toggle operations, but no AJAX, effects, or utility functions. You’re expected to use native fetch() and CSS transitions instead.
// umbrellajs: DOM-only
u('form').on('submit', e => {
e.preventDefault();
fetch('/submit', { method: 'POST' })
.then(r => r.text())
.then(html => u('#result').html(html));
});
zepto includes a subset of jQuery’s features — AJAX, events, and basic DOM methods — but omits many edge cases and advanced utilities. However, due to lack of updates, its AJAX module doesn’t handle modern CORS or AbortController patterns correctly.
// zepto: limited AJAX (not recommended)
$.get('/api/data', data => {
$('#content').html(data);
});
jquery ships with UMD, CJS, and ESM builds. It integrates cleanly with Webpack, Rollup, and modern toolchains. Tree-shaking is limited because most of jQuery is interdependent.
umbrellajs is authored in ES modules and supports tree-shaking out of the box. You can import only what you need (though its API surface is already small).
// umbrellajs: ESM-friendly
import u from 'umbrellajs';
zepto only provides a global Zepto object via a single IIFE script. It lacks proper module exports, making it difficult to use in modern bundlers without shims.
If you’re maintaining a legacy codebase using jQuery plugins (e.g., sliders, date pickers), only jquery will work — these plugins rely on jQuery’s internal architecture and global $.
For greenfield projects targeting modern browsers, umbrellajs gives you ~90% of jQuery’s daily-use syntax (find, on, addClass, html) with 95% less code. But you’ll need to replace plugins with vanilla alternatives or modern component libraries.
Zepto’s syntax is nearly identical to jQuery, but subtle differences (e.g., in event handling or selector engine behavior) cause bugs when porting code. Given its unmaintained status, migration paths are risky.
| Scenario | Recommended Library |
|---|---|
| Supporting IE11 or older | jquery |
| Modern web app (Chrome/Firefox/Safari latest) | umbrellajs |
| Mobile-only app with no build system | ❌ Avoid Zepto; use umbrellajs or vanilla JS |
| Existing jQuery plugin dependency | jquery |
| Need AJAX/effects/utilities out of the box | jquery |
| Minimal bundle size, modern environment | umbrellajs |
jquery if you’re in a legacy environment, depend on jQuery plugins, or need guaranteed cross-browser behavior — even at the cost of bundle size.umbrellajs if you’re building a new application for modern browsers and want jQuery-like ergonomics without the bloat. Pair it with native fetch, CSS transitions, and small utility libraries as needed.zepto in any new project. Its lack of maintenance, poor tooling support, and incomplete modern browser coverage make it a liability.In 2024, the real question isn’t “jQuery vs Zepto vs Umbrella” — it’s whether you even need a DOM library at all. For many use cases, modern vanilla JavaScript (document.querySelector, addEventListener, fetch, classList) is sufficient and eliminates dependencies entirely. But when you do need that extra layer of convenience, choose wisely based on your runtime constraints — not nostalgia.
Choose jquery if you need to support legacy browsers (including IE11), rely on a vast ecosystem of jQuery plugins, or require built-in AJAX, effects, and utility functions. It remains the only practical option for enterprise environments with strict browser compatibility requirements, despite its larger bundle size.
Choose umbrellajs if you're building a new application that targets modern browsers only and want a lightweight, jQuery-like API without the legacy baggage. It integrates well with modern tooling, supports tree-shaking, and encourages use of native browser features like fetch and CSS transitions.
Do not choose zepto for any new project. It is effectively unmaintained, lacks proper module support for modern bundlers, and has known compatibility issues with current mobile browsers. Its historical role as a mobile-focused jQuery alternative has been superseded by both vanilla JavaScript and actively maintained libraries like umbrellajs.
jQuery is a fast, small, and feature-rich JavaScript library.
For information on how to get started and how to use jQuery, please see jQuery's documentation. For source files and issues, please visit the jQuery repo.
If upgrading, please see the blog post for 4.0.0. This includes notable differences from the previous version and a more readable changelog.
Below are some of the most common ways to include jQuery.
<script src="https://code.jquery.com/jquery-4.0.0.min.js"></script>
or, to use the jQuery ECMAScript module:
<script type="module">
import { $ } from "https://code.jquery.com/jquery-4.0.0.module.min.js";
</script>
or:
<script type="module">
import { jQuery } from "https://code.jquery.com/jquery-4.0.0.module.min.js";
</script>
All jQuery modules export named $ & jQuery tokens; the further examples will just show $. The default import also works:
<script type="module">
import $ from "https://code.jquery.com/jquery-4.0.0.module.min.js";
</script>
However, named imports provide better interoperability across tooling and are therefore recommended.
Sometimes you don’t need AJAX, or you prefer to use one of the many standalone libraries that focus on AJAX requests. And often it is simpler to use a combination of CSS, class manipulation or the Web Animations API. Similarly, many projects opt into relying on native browser promises instead of jQuery Deferreds. Along with the regular version of jQuery that includes the ajax, callbacks, deferred, effects & queue modules, we’ve released a “slim” version that excludes these modules. You can load it as a regular script:
<script src="https://code.jquery.com/jquery-4.0.0.slim.min.js"></script>
or as a module:
<script type="module">
import { $ } from "https://code.jquery.com/jquery-4.0.0.module.slim.min.js";
</script>
To avoid repeating long import paths that change on each jQuery release, you can use import maps - they are now supported in every modern browser. Put the following script tag before any <script type="module">:
<script type="importmap">
{
"imports": {
"jquery": "https://code.jquery.com/jquery-4.0.0.module.min.js",
"jquery/slim": "https://code.jquery.com/jquery-4.0.0.module.slim.min.js"
}
}
</script>
Now, the following will work to get the full version:
<script type="module">
import { $ } from "jquery";
// Use $ here
</script>
and the following to get the slim one:
<script type="module">
import { $ } from "jquery/slim";
// Use $ here
</script>
The advantage of these specific mappings is they match the ones embedded in the jQuery npm package, providing better interoperability between the environments.
You can also use jQuery from npm even in the browser setup. Read along for more details.
There are several ways to use jQuery from npm. One is to use a build tool like Webpack, Browserify or Babel. For more information on using these tools, please refer to the corresponding project's documentation.
Another way is to use jQuery directly in Node.js. See the Node.js pre-requisites section for more details on the Node.js-specific part of this.
To install the jQuery npm package, invoke:
npm install jquery
In the script, including jQuery will usually look like this:
import { $ } from "jquery";
If you need to use jQuery in a file that's not an ECMAScript module, you can use the CommonJS syntax:
const $ = require( "jquery" );
The CommonJS module does not expose named $ & jQuery exports.
jQuery is authored in ECMAScript modules; it's also possible to use them directly. They are contained in the src/ folder; inspect the package contents to see what's there. Full file names are required, including the .js extension.
Be aware that this is an advanced & low-level interface, and we don't consider it stable, even between minor or patch releases - this is especially the case for modules in subdirectories or src/. If you rely on it, verify your setup before updating jQuery.
All top-level modules, i.e. files directly in the src/ directory export jQuery. Importing multiple modules will all attach to the same jQuery instance.
Remember that some modules have other dependencies (e.g. the event module depends on the selector one) so in some cases you may get more than you expect.
Example usage:
import { $ } from "jquery/src/css.js"; // adds the `.css()` method
import "jquery/src/event.js"; // adds the `.on()` method; pulls "selector" as a dependency
$( ".toggle" ).on( "click", function() {
$( this ).css( "color", "red" );
} );
AMD is a module format built for the browser. For more information, we recommend require.js' documentation.
define( [ "jquery" ], function( $ ) {
} );
Node.js doesn't understand AMD natively so this method is mostly used in a browser setup.
For jQuery to work in Node, a window with a document is required. Since no such window exists natively in Node, one can be mocked by tools such as jsdom. This can be useful for testing purposes.
For Node-based environments that don't have a global window, jQuery exposes a dedicated jquery/factory entry point.
To import jQuery using this factory, use the following:
import { JSDOM } from "jsdom";
const { window } = new JSDOM( "" );
import { jQueryFactory } from "jquery/factory";
const $ = jQueryFactory( window );
or, if you use require:
const { JSDOM } = require( "jsdom" );
const { window } = new JSDOM( "" );
const { jQueryFactory } = require( "jquery/factory" );
const $ = jQueryFactory( window );
To use the slim build of jQuery in Node.js, use "jquery/slim" instead of "jquery" in both require or import calls above. To use the slim build in Node.js with factory mode, use jquery/factory-slim instead of jquery/factory.