Learn jQuery from scratch: selectors, DOM manipulation, events, animations, AJAX and clean plugin design.
Write Less, Do More jQuery is a fast, small, feature-rich JavaScript library that simplifies HTML document traversal and manipulation, event handling, animation and AJAX. Created ...
Two Ways to Add jQuery You can download the file and host it yourself, or load it from a CDN. The CDN is fastest and caches across sites. Official CDN Place the script tag before ...
Reaching Elements by CSS Syntax jQuery selectors are CSS selectors extended with a few jQuery-specific helpers. They return a jQuery object wrapping the matching elements. Core ...
Reading and Writing Content Without arguments these methods read; with an argument they write. Adding and Removing Elements Attributes and Classes Styling Key Points text/html/val ...
Responding to User Actions Events are the bridge between the page and the user. jQuery normalizes them across browsers and lets you attach handlers with one method. Common Event ...
Effects With One Line The number is the duration in milliseconds. A callback can run when the effect finishes. Complete Callbacks Custom Animations With .animate() CSS properties ...
Fetching Data Without Reloading jQuery wraps the painful XMLHttpRequest API into a small, consistent set of methods. $.get and $.post Loading HTML Into an Element .load fetches ...
Selections Are jQuery Objects A selector returns a jQuery object: an array-like wrapper around DOM nodes with all jQuery methods attached. Iterating Inside each(), this is the raw ...
Reading Form Values Serializing the Whole Form serialize() builds a query string ready for $.post or a URL. serializeArray() gives structured objects for JSON APIs. Client-Side ...
Extending jQuery A plugin adds a method to jQuery.fn (the prototype of all jQuery objects), so every element selection can call it. A Minimal Plugin The (function ($) { ... ...
When jQuery Is Not Needed Modern browsers implement most jQuery features natively. Knowing the equivalents helps you write lighter code and understand both worlds. A Quick ...
Patterns That Keep jQuery Clean Cache selections: var $list = $('#list'); - do not re-query the DOM in loops. Start on ready: wrap setup in $(function () { ... }); . Delegate ...