jQuery Cheat Sheet

This section documents jQuery 3.x (the current major line — no specific patch version is pinned). This content was generated with the assistance of AI and should be verified against the official jQuery API reference before being relied on in production, since API details and deprecations continue to change between releases.

jQuery is legacy-leaning: modern browsers implement native equivalents for almost everything it does (querySelectorAll, classList, fetch, addEventListener, append/prepend/remove, the Web Animations API), and most current stacks — Bootstrap 5 included — have dropped it. Prefer the native APIs for new work; this reference is aimed at reading, maintaining, or incrementally migrating code that already uses jQuery. Every page ends with a Modern equivalent note pointing at the native replacement.

This section’s bibliography lists the reference material consulted while preparing these pages.

A single-page, colour-coded summary of the jQuery essentials — loading jQuery from the CDN and the document-ready pattern, the most common selectors, the traversal and filtering methods, DOM-manipulation methods, class / css / attr / dimension methods, effects, .on() and the event object, .data() and the static utilities, jQuery.ajax() and its shorthands, and a "jQuery to native" migration table — handy for quick memorization or as a printable desk reference.

For the full explanation, every option, and additional examples, see the dedicated pages:

Selecting and traversing — jQuery Selectors and Traversal and Chaining.

Talking to the server — AJAX.