jQuery has two usage styles:

Typically, access to and manipulation of multiple DOM nodes begins with the codice_3 function being called with a CSS selector string, which results in a jQuery object referencing matching elements in the HTML page. This node set can be manipulated by calling instance methods on the jQuery object, or on the nodes themselves. For example:

$("div.test").add("p.quote").addClass("blue").slideDown("slow");

This line finds the union of all codice_6 tags with class attribute codice_7 and all codice_8 tags with CSS class attribute codice_9, adds the class attribute codice_10 to each matched element, and then increases their height with an animation. The codice_3 and codice_12 functions affect the matched set, while the codice_13 and codice_14 affect the referenced nodes.

Besides accessing DOM nodes through jQuery object hierarchy, it is also possible to create new DOM elements if a string passed as the argument to $() looks like HTML. For example, this line finds an HTML SELECT element with ID="carmakes", and adds an OPTION element with value "VAG" and text "Volkswagen":

$('select#carmakes').append($('<option />').attr({value:"VAG"}).append("Volkswagen"));
The methods prefixed with codice_4 are convenience methods or affect global properties and behaviour. For example, the following is an example of the iterating function called codice_16 in jQuery:

$.each([1,2,3], function() {

This writes "2", "3", "4" to the console.

It is possible to perform browser-independent Ajax queries using codice_17 and associated methods to load and manipulate remote data.

$.ajax({
}).success( function(msg) {
}).fail( function( xmlHttpRequest, statusText, errorThrown ) {

This example posts the data codice_18 and codice_19 to codice_20 on the server. When this request finishes successfully, the success function is called to alert the user. If the request fails, it will alert the user to the failure, the status of the request, and the specific error.

Usage styles
Testing framework
jQuery plug-ins
Including the library