Please Donate!
show shoutbox!
json 2 html

json

Quoting from the home page of JSON
JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate.

syntax highlighting:

Colour for text and null values.
Colour for numbers.
Colour for true and false values.
Colour for void values.
Background for Objects.
Background for Arrays.
Background for Object name/value pair tables.
Background for Array value tables.

dependencies

This page uses the JSON JavaScript parsing library.

note

Words longer than 30 characters may be broken into two or more lines to save space.

This page offers an easy way to visualize a string of JSON text. Put some JSON into the text area, and this page will instantly display the text as a set of nested boxes, corresponding to the objects, arrays and values in the JSON string.
You can also paste a URL into the textarea, and the JSON string will be loaded from the URL.
Check out my new project, rss2html - embed RSS feeds directly into HTML.


Number of Arrays: 809
Number of Objects: 785
Total number of all elements: 4468
Nesting depth: 4

Array

IndexValue
0

Object

NameValue
catCore
descCreate a new jQuery Object
params(empty Array)
shortCreate a new jQuery Object
examples(empty Array)
constructor

Array

IndexValue
01
tests

Array

IndexValue
0ok( Array.prototype.push, "Array.push()" );
ok( Function.prototype.apply, "Function.apply()" );
ok( document.getElementById, "getElementById" );
ok( document.getElementsByTagName, "getElementsByTagName" );
ok( RegExp, "RegExp" );
ok( jQuery, "jQuery" );
ok( $, "$()" );
private1
namejQuery
1

Object

NameValue
shortThis function accepts a string containing a CSS selector,
basic XPath, or raw HTML, which is then used to match a set of elements.
params

Array

IndexValue
0

Object

NameValue
typeString
descAn expression to search with, or a string of HTML to create on the fly.
nameexpr
descThis function accepts a string containing a CSS selector,
basic XPath, or raw HTML, which is then used to match a set of elements.
The HTML string is different from the traditional selectors in that
it creates the DOM elements representing that HTML string, on the fly,
to be (assumedly) inserted into the document later.

The core functionality of jQuery centers around this function.
Everything in jQuery is based upon this, or uses this in some way.
The most basic use of this function is to pass in an expression
(usually consisting of CSS or XPath), which then finds all matching
elements and remembers them for later use.

By default, $() looks for DOM elements within the context of the
current HTML document.
tests(empty Array)
typejQuery
name$
examples

Array

IndexValue
0

Object

NameValue
descThis finds all p elements that are children of a div element.
beforep>one</p> /p></div>t;<p>two</p>&lt amp;gt;three</p>
code$("div > p")
result[ p>two</p> ]
1

Object

NameValue
descCreates a div element (and all of its contents) dynamically,
and appends it to the element with the ID of body. Internally, an
element is created and it's innerHTML property set to the given markup.
It is therefore both quite flexible and limited.
codeiv>").appendTo("#body")lo</p></div>").appendTo("#body")iv><p>Hello</p
catCore
2

Object

NameValue
shortThis function accepts a string containing a CSS selector, or
basic XPath, which is then used to match a set of elements with the
context of the specified DOM element, or document
params

Array

IndexValue
0

Object

NameValue
typeString
descAn expression to search with.
nameexpr
1

Object

NameValue
typeElement
descA DOM Element, or Document, representing the base context.
namecontext
descThis function accepts a string containing a CSS selector, or
basic XPath, which is then used to match a set of elements with the
context of the specified DOM element, or document
tests(empty Array)
typejQuery
name$
examples

Array

IndexValue
0

Object

NameValue
descThis finds all div elements within the specified XML document.
code$("div", xml.responseXML)
catCore
3

Object

NameValue
shortWrap jQuery functionality around a specific DOM Element.
params

Array

IndexValue
0

Object

NameValue
typeElement
descA DOM element to be encapsulated by a jQuery object.
nameelem
descWrap jQuery functionality around a specific DOM Element.
This function also accepts XML Documents and Window objects
as valid arguments (even though they are not DOM Elements).
tests(empty Array)
typejQuery
name$
examples

Array

IndexValue
0

Object

NameValue
code$(document).find("div > p")
result[ p>two</p> ]
beforep>one</p> /p></div>t;<p>two</p>&lt amp;gt;three</p>
1

Object

NameValue
descSets the background color of the page to black.
code$(document.body).background( "black" );
catCore
4

Object

NameValue
shortWrap jQuery functionality around a set of DOM Elements.
params

Array

IndexValue
0

Object

NameValue
typeArray<Element>
descAn array of DOM elements to be encapsulated by a jQuery object.
nameelems
descWrap jQuery functionality around a set of DOM Elements.
tests(empty Array)
typejQuery
name$
examples

Array

IndexValue
0

Object

NameValue
descHides all the input elements within a form
code$( myForm.elements ).hide()
catCore
5

Object

NameValue
shortA shorthand for $(document).
params

Array

IndexValue
0

Object

NameValue
typeFunction
descThe function to execute when the DOM is ready.
namefn
descA shorthand for $(document).ready(), allowing you to bind a function
to be executed when the DOM document has finished loading. This function
behaves just like $(document).ready(), in that it should be used to wrap
all of the other $() operations on your page. While this function is,
technically, chainable - there really isn't much use for chaining against it.
You can have as many $(document).ready events on your page as you like.
tests(empty Array)
typejQuery
name$
examples

Array

IndexValue
0

Object

NameValue
descExecutes the function when the DOM is ready to be used.
code$(function(){
// Document is ready
});
catCore
6

Object

NameValue
shortA means of creating a cloned copy of a jQuery object.
params

Array

IndexValue
0

Object

NameValue
typejQuery
descThe jQuery object to be cloned.
nameobj
descA means of creating a cloned copy of a jQuery object. This function
copies the set of matched elements from one jQuery object and creates
another, new, jQuery object containing the same elements.
tests(empty Array)
typejQuery
name$
examples

Array

IndexValue
0

Object

NameValue
descLocates all p elements with all div elements, without disrupting the original jQuery object contained in 'div' (as would normally be the case if a simple div.find("p") was done).
codevar div = $("div");
$( div ).find("p");
catCore
7

Object

NameValue
property1
catCore
typeString
descThe current version of jQuery.
params(empty Array)
shortThe current version of jQuery.
examples(empty Array)
tests(empty Array)
private1
namejquery
8

Object

NameValue
property1
catCore
typeNumber
descThe number of elements currently matched.
params(empty Array)
shortThe number of elements currently matched.
examples

Array

IndexValue
0

Object

NameValue
code$("img").length;
result2
before<img src="test1.jpg"/> <img src="test2.jpg"/>
tests

Array

IndexValue
0ok( $("div").length == 2, "Get Number of Elements Found" );
namelength
9

Object

NameValue
shortThe number of elements currently matched.
params(empty Array)
descThe number of elements currently matched.
tests

Array

IndexValue
0ok( $("div").size() == 2, "Get Number of Elements Found" );
typeNumber
namesize
examples

Array

IndexValue
0

Object

NameValue
code$("img").size();
result2
before<img src="test1.jpg"/> <img src="test2.jpg"/>
catCore
10

Object

NameValue
shortAccess all matched elements.
params(empty Array)
descAccess all matched elements. This serves as a backwards-compatible
way of accessing all matched elements (other than the jQuery object
itself, which is, in fact, an array of elements).
tests

Array

IndexValue
0isSet( $("div").get(), q("main","foo"), "Get All Elements" );
typeArray<Element>
nameget
examples

Array

IndexValue
0

Object

NameValue
code$("img").get();
result[ <img src="test1.jpg"/> <img src="test2.jpg"/> ]
before<img src="test1.jpg"/> <img src="test2.jpg"/>
catCore
11

Object

NameValue
shortAccess a single matched element.
params

Array

IndexValue
0

Object

NameValue
typeNumber
descAccess the element in the Nth position.
namenum
descAccess a single matched element. num is used to access the
Nth element matched.
tests

Array

IndexValue
0ok( $("div").get(0) == cument.getElementById("main"), "Get A Single Element" );
typeElement
nameget
examples

Array

IndexValue
0

Object

NameValue
code$("img").get(1);
result[ <img src="test1.jpg"/> ]
before<img src="test1.jpg"/> <img src="test2.jpg"/>
catCore
12

Object

NameValue
catCore
typejQuery
descSet the jQuery object to an array of elements.
params

Array

IndexValue
0

Object

NameValue
typeElements
descAn array of elements
nameelems
shortSet the jQuery object to an array of elements.
examples

Array

IndexValue
0

Object

NameValue
code$("img").get([ document.body ]);
result$("img").get() == [ document.body ]
tests(empty Array)
private1
nameget
13

Object

NameValue
shortExecute a function within the context of every matched element.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descA function to execute
namefn
descExecute a function within the context of every matched element.
This means that every time the passed-in function is executed
(which is once for every element matched) the 'this' keyword
points to the specific element.

Additionally, the function, when executed, is passed a single
argument representing the position of the element in the matched
set.
tests

Array

IndexValue
0var div = $("div");
div.each(function(){this.foo = 'zoo';});
var pass = true;
for ( var i = 0; i < div.size(); i++ ) {
if ( div.get(i).foo != "zoo" ) pass = false;
}
ok( pass, "Execute a function, Relative" );
typejQuery
nameeach
examples

Array

IndexValue
0

Object

NameValue
code$("img").each(function(){
this.src = "test.jpg";
});
result<img src="test.jpg"/> <img src="test.jpg"/>
before<img/> <img/>
1

Object

NameValue
code$("img").each(function(i){
alert( "Image #" + i + " is " + this );
});
result<img src="test.jpg"/> <img src="test.jpg"/>
before<img/> <img/>
catCore
14

Object

NameValue
shortSearches every matched element for the object and returns
the index of the element, if found, starting with zero.
params

Array

IndexValue
0

Object

NameValue
typeObject
descObject to search for
nameobj
descSearches every matched element for the object and returns
the index of the element, if found, starting with zero.
Returns -1 if the object wasn't found.
tests

Array

IndexValue
0ok( $([window, document]).index(window) == 0, "Check for index of elements" );
ok( $([window, document]).index(document) == 1, "Check for index of elements" );
var inputElements = ,#radio2,#check1,#check2');
/>ok( ment.getElementById('radio1')) == 0, "Check for index of elements" );
ok( ment.getElementById('radio2')) == 1, "Check for index of elements" );
ok( ment.getElementById('check1')) == 2, "Check for index of elements" );
ok( ment.getElementById('check2')) == 3, "Check for index of elements" );
ok( inputElements.index(window) == -1, "Check for not found index" );
ok( inputElements.index(document) == -1, "Check for not found index" );
typeNumber
nameindex
examples

Array

IndexValue
0

Object

NameValue
codement.getElementById('foobar'))
result0
before<div </b><span;/div><b></b>< "></span>
1

Object

NameValue
codeocument.getElementById('foo'))
result2
before<div </b><span;/div><b></b>< "></span>
2

Object

NameValue
codeocument.getElementById('bar'))
result-1
before<div </b><span;/div><b></b>< "></span>
catCore
15

Object

NameValue
shortAccess a property on the first matched element.
params

Array

IndexValue
0

Object

NameValue
typeString
descThe name of the property to access.
namename
descAccess a property on the first matched element.
This method makes it easy to retrieve a property value
from the first matched element.
tests

Array

IndexValue
0ok( $('#text1').attr('value') == "Test", 'Check for value attribute' );
ok( $('#text1').attr('type') == "text", 'Check for type attribute' );
ok( $('#radio1').attr('type') == "radio", 'Check for type attribute' );
ok( $('#check1').attr('type') == "checkbox", 'Check for type attribute' );
ok( $('#simon1').attr('rel') == "bookmark", 'Check for rel attribute' );
ok( $('#google').attr('title') == "Google!", 'Check for title attribute' );
ok( $('#mark').attr('hreflang') == "en", 'Check for hreflang attribute' );
ok( $('#en').attr('lang') == "en", 'Check for lang attribute' );
ok( $('#simon').attr('class') == "blog link", 'Check for class attribute' );
ok( $('#name').attr('name') == "name", 'Check for name attribute' );
ok( $('#text1').attr('name') == "action", 'Check for name attribute' );
ok( action').indexOf("formaction") >= 0, 'Check for action attribute' );
typeObject
nameattr
examples

Array

IndexValue
0

Object

NameValue
code$("img").attr("src");
resulttest.jpg
before<img src="test.jpg"/>
catDOM
16

Object

NameValue
shortSet a hash of key/value object properties to all matched elements.
params

Array

IndexValue
0

Object

NameValue
typeHash
descA set of key/value pairs to set as object properties.
nameprop
descSet a hash of key/value object properties to all matched elements.
This serves as the best way to set a large number of properties
on all matched elements.
tests

Array

IndexValue
0var pass = true;
$("div").attr({foo: 'baz', zoo: 'ping'}).each(function(){
if ( this.getAttribute('foo') != "baz" && this.getAttribute('zoo') != "ping" ) pass = false;
});
ok( pass, "Set Multiple Attributes" );
typejQuery
nameattr
examples

Array

IndexValue
0

Object

NameValue
code$("img").attr({ src: "test.jpg", alt: "Test Image" });
result<img src="test.jpg" alt="Test Image"/>
before<img/>
catDOM
17

Object

NameValue
shortSet a single property to a value, on all matched elements.
params

Array

IndexValue
0

Object

NameValue
typeString
descThe name of the property to set.
namekey
1

Object

NameValue
typeObject
descThe value to set the property to.
namevalue
descSet a single property to a value, on all matched elements.
tests

Array

IndexValue
0var div = $("div");
div.attr("foo", "bar");
var pass = true;
for ( var i = 0; i < div.size(); i++ ) {
if ( div.get(i).getAttribute('foo') != "bar" ) pass = false;
}
ok( pass, "Set Attribute" );

$("#name").attr('name', 'something');
ok( $("#name").name() == 'something', 'Set name attribute' );
$("#check2").attr('checked', true);
ok( tElementById('check2').checked == true, 'Set checked attribute' );
$("#check2").attr('checked', false);
ok( tElementById('check2').checked == false, 'Set checked attribute' );
typejQuery
nameattr
examples

Array

IndexValue
0

Object

NameValue
code"img").attr("src","test.jpg");
result<img src="test.jpg"/>
before<img/>
catDOM
18

Object

NameValue
shortAccess a style property on the first matched element.
params

Array

IndexValue
0

Object

NameValue
typeString
descThe name of the property to access.
namename
descAccess a style property on the first matched element.
This method makes it easy to retrieve a style property value
from the first matched element.
tests

Array

IndexValue
0ok( $('#main').css("display") == 'none', 'Check for css property "display"');
typeObject
namecss
examples

Array

IndexValue
0

Object

NameValue
descRetrieves the color style of the first paragraph
before<p style="color:red;">Test Paragraph.</p>
code$("p").css("color");
resultred
1

Object

NameValue
descRetrieves the font-weight style of the first paragraph.
Note that for all style properties with a dash (like 'font-weight'), you have to
write it in camelCase. In other words: Every time you have a '-' in a
property, remove it and replace the next character with an uppercase
representation of itself. Eg. fontWeight, fontSize, fontFamily, borderWidth,
borderStyle, borderBottomWidth etc.
before<p style="font-weight: bold;">Test Paragraph.</p>
code$("p").css("fontWeight");
resultbold
catCSS
19

Object

NameValue
shortSet a hash of key/value style properties to all matched elements.
params

Array

IndexValue
0

Object

NameValue
typeHash
descA set of key/value pairs to set as style properties.
nameprop
descSet a hash of key/value style properties to all matched elements.
This serves as the best way to set a large number of style properties
on all matched elements.
tests

Array

IndexValue
0ok( $('#foo').is(':visible'), 'Modifying CSS display: Assert element is visible');
$('#foo').css({display: 'none'});
ok( !$('#foo').is(':visible'), 'Modified CSS display: Assert element is hidden');
$('#foo').css({display: 'block'});
ok( $('#foo').is(':visible'), 'Modified CSS display: Assert element is visible');
typejQuery
namecss
examples

Array

IndexValue
0

Object

NameValue
code$("p").css({ color: "red", background: "blue" });
result<p style="color:red; background:blue;">Test Paragraph.</p>
before<p>Test Paragraph.</p>
catCSS
20

Object

NameValue
shortSet a single style property to a value, on all matched elements.
params

Array

IndexValue
0

Object

NameValue
typeString
descThe name of the property to set.
namekey
1

Object

NameValue
typeObject
descThe value to set the property to.
namevalue
descSet a single style property to a value, on all matched elements.
tests

Array

IndexValue
0ok( $('#foo').is(':visible'), 'Modifying CSS display: Assert element is visible');
$('#foo').css('display', 'none');
ok( !$('#foo').is(':visible'), 'Modified CSS display: Assert element is hidden');
$('#foo').css('display', 'block');
ok( $('#foo').is(':visible'), 'Modified CSS display: Assert element is visible');
typejQuery
namecss
examples

Array

IndexValue
0

Object

NameValue
descChanges the color of all paragraphs to red
before<p>Test Paragraph.</p>
code$("p").css("color","red");
result<p style="color:red;">Test Paragraph.</p>
catCSS
21

Object

NameValue
shortRetrieve the text contents of all matched elements.
params(empty Array)
descRetrieve the text contents of all matched elements. The result is
a string that contains the combined text contents of all matched
elements. This method works on both HTML and XML documents.
tests

Array

IndexValue
0var expected = "This link has class=\"blog\": Simon Willison's Weblog";
ok( $('#sap').text() == expected, 'Check for merged text of more then one element.' );
typeString
nametext
examples

Array

IndexValue
0

Object

NameValue
code$("p").text();
resultTest Paragraph.
before<p>Test Paragraph.</p>
catDOM
22

Object

NameValue
shortWrap all matched elements with a structure of other elements.
params

Array

IndexValue
0

Object

NameValue
typeString
descA string of HTML, that will be created on the fly and wrapped around the target.
namehtml
descWrap all matched elements with a structure of other elements.
This wrapping process is most useful for injecting additional
stucture into a document, without ruining the original semantic
qualities of a document.

This works by going through the first element
provided (which is generated, on the fly, from the provided HTML)
and finds the deepest ancestor element within its
structure - it is that element that will en-wrap everything else.

This does not work with elements that contain text. Any necessary text
must be added after the wrapping is done.
tests

Array

IndexValue
0var defaultText = 'Try them out:'
var result = $('#first').wrap('<div p;lt;/div>').text();
mp;gt;</span></div>').text();
ss="red"><span& />ok( defaultText == result, 'Check for wrapping of on-the-fly html' );
ok( .parent().parent().is('.red'), 'Check if wrapper has class "red"' );
typejQuery
namewrap
examples

Array

IndexValue
0

Object

NameValue
code$("p").wrap("<div amp;gt;</div>");
result<div '><p>Test /p></div>
before<p>Test Paragraph.</p>
catDOM/Manipulation
23

Object

NameValue
shortWrap all matched elements with a structure of other elements.
params

Array

IndexValue
0

Object

NameValue
typeElement
descA DOM element that will be wrapped.
nameelem
descWrap all matched elements with a structure of other elements.
This wrapping process is most useful for injecting additional
stucture into a document, without ruining the original semantic
qualities of a document.

This works by going through the first element
provided and finding the deepest ancestor element within its
structure - it is that element that will en-wrap everything else.

This does not work with elements that contain text. Any necessary text
must be added after the wrapping is done.
tests

Array

IndexValue
0var defaultText = 'Try them out:'
var result = entById('empty')).parent();
#first').wrap(document.getElement />ok( result.is('ol'), 'Check for element wrapping' );
ok( result.text() == defaultText, 'Check for element wrapping' );
typejQuery
namewrap
examples

Array

IndexValue
0

Object

NameValue
code$("p").wrap( ment.getElementById('content') );
result<div "><p>Test /p></div>
before<p>Test .</p><div t"></div>
catDOM/Manipulation
24

Object

NameValue
shortAppend any number of elements to the inside of every matched elements,
generated from the provided HTML.
params

Array

IndexValue
0

Object

NameValue
typeString
descA string of HTML, that will be created on the fly and appended to the target.
namehtml
descAppend any number of elements to the inside of every matched elements,
generated from the provided HTML.
This operation is similar to doing an appendChild to all the
specified elements, adding them into the document.
tests

Array

IndexValue
0var defaultText = 'Try them out:'
var result = t;buga</b>');
irst').append('<b>bug />ok( result.text() == defaultText + 'buga', 'Check if text appending works' );
typejQuery
nameappend
examples

Array

IndexValue
0

Object

NameValue
code;gt;Hello</b>");
result<p>I would like to say: t;/b></p>
before<p>I would like to say: </p>
catDOM/Manipulation
25

Object

NameValue
shortAppend an element to the inside of all matched elements.
params

Array

IndexValue
0

Object

NameValue
typeElement
descA DOM element that will be appended.
nameelem
descAppend an element to the inside of all matched elements.
This operation is similar to doing an appendChild to all the
specified elements, adding them into the document.
tests

Array

IndexValue
0var expected = "This link has class=\"blog\": Simon Willison's WeblogTry them out:";

/>ok( expected == $('#sap').text(), "Check for appending of element" );
typejQuery
nameappend
examples

Array

IndexValue
0

Object

NameValue
code$("p").append( $("#foo")[0] );
result<p>I would like to say: <b t;/b></p>
before<p>I would like to say: </p><b amp;gt;Hello</b>
catDOM/Manipulation
26

Object

NameValue
shortAppend any number of elements to the inside of all matched elements.
params

Array

IndexValue
0

Object

NameValue
typeArray<Element>
descAn array of elements, all of which will be appended.
nameelems
descAppend any number of elements to the inside of all matched elements.
This operation is similar to doing an appendChild to all the
specified elements, adding them into the document.
tests

Array

IndexValue
0var expected = "This link has class=\"blog\": Simon Willison's WeblogTry them out:Yahoo";
.getElementById('yahoo')]);
/>ok( expected == $('#sap').text(), "Check for appending of array of elements" );
typejQuery
nameappend
examples

Array

IndexValue
0

Object

NameValue
code$("p").append( $("b") );
result<p>I would like to say: t;/b></p>
before<p>I would like to say: amp;gt;Hello</b>
catDOM/Manipulation
27

Object

NameValue
shortPrepend any number of elements to the inside of every matched elements,
generated from the provided HTML.
params

Array

IndexValue
0

Object

NameValue
typeString
descA string of HTML, that will be created on the fly and appended to the target.
namehtml
descPrepend any number of elements to the inside of every matched elements,
generated from the provided HTML.
This operation is the best way to insert dynamically created elements
inside, at the beginning, of all the matched element.
tests

Array

IndexValue
0var defaultText = 'Try them out:'
var result = t;buga</b>');
rst').prepend('<b>buga />ok( result.text() == 'buga' + defaultText, 'Check if text prepending works' );
typejQuery
nameprepend
examples

Array

IndexValue
0

Object

NameValue
code;gt;Hello</b>");
resultmp;gt;Hello</b>I would like to say: </p>
before<p>I would like to say: </p>
catDOM/Manipulation
28

Object

NameValue
shortPrepend an element to the inside of all matched elements.
params

Array

IndexValue
0

Object

NameValue
typeElement
descA DOM element that will be appended.
nameelem
descPrepend an element to the inside of all matched elements.
This operation is the best way to insert an element inside, at the
beginning, of all the matched element.
tests

Array

IndexValue
0var expected = "Try them out:This link has class=\"blog\": Simon Willison's Weblog";

/>ok( expected == $('#sap').text(), "Check for prepending of element" );
typejQuery
nameprepend
examples

Array

IndexValue
0

Object

NameValue
code$("p").prepend( $("#foo")[0] );
result<p><b mp;gt;Hello</b>I would like to say: </p>
before<p>I would like to say: </p><b amp;gt;Hello</b>
catDOM/Manipulation
29

Object

NameValue
shortPrepend any number of elements to the inside of all matched elements.
params

Array

IndexValue
0

Object

NameValue
typeArray<Element>
descAn array of elements, all of which will be appended.
nameelems
descPrepend any number of elements to the inside of all matched elements.
This operation is the best way to insert a set of elements inside, at the
beginning, of all the matched element.
tests

Array

IndexValue
0var expected = "Try them out:YahooThis link has class=\"blog\": Simon Willison's Weblog";
.getElementById('yahoo')]);
/>ok( expected == $('#sap').text(), "Check for prepending of array of elements" );
typejQuery
nameprepend
examples

Array

IndexValue
0

Object

NameValue
code$("p").prepend( $("b") );
resultmp;gt;Hello</b>I would like to say: </p>
before<p>I would like to say: amp;gt;Hello</b>
catDOM/Manipulation
30

Object

NameValue
shortInsert any number of dynamically generated elements before each of the
matched elements.
params

Array

IndexValue
0

Object

NameValue
typeString
descA string of HTML, that will be created on the fly and appended to the target.
namehtml
descInsert any number of dynamically generated elements before each of the
matched elements.
tests

Array

IndexValue
0var expected = 'This is a normal link: bugaYahoo';

ahoo').before('<b>buga& />ok( expected == $('#en').text(), 'Insert String before' );
typejQuery
namebefore
examples

Array

IndexValue
0

Object

NameValue
code;gt;Hello</b>");
resultt;/b><p>I would like to say: </p>
before<p>I would like to say: </p>
catDOM/Manipulation
31

Object

NameValue
shortInsert an element before each of the matched elements.
params

Array

IndexValue
0

Object

NameValue
typeElement
descA DOM element that will be appended.
nameelem
descInsert an element before each of the matched elements.
tests

Array

IndexValue
0var expected = "This is a normal link: Try them out:Yahoo";

/>ok( expected == $('#en').text(), "Insert element before" );
typejQuery
namebefore
examples

Array

IndexValue
0

Object

NameValue
code$("p").before( $("#foo")[0] );
result<b t;/b><p>I would like to say: </p>
before<p>I would like to say: </p><b amp;gt;Hello</b>
catDOM/Manipulation
32

Object

NameValue
shortInsert any number of elements before each of the matched elements.
params

Array

IndexValue
0

Object

NameValue
typeArray<Element>
descAn array of elements, all of which will be appended.
nameelems
descInsert any number of elements before each of the matched elements.
tests

Array

IndexValue
0var expected = "This is a normal link: Try them out:diveintomarkYahoo";
t.getElementById('mark')]);
/>ok( expected == $('#en').text(), "Insert array of elements before" );
typejQuery
namebefore
examples

Array

IndexValue
0

Object

NameValue
code$("p").before( $("b") );
resultt;/b><p>I would like to say: </p>
before<p>I would like to say: amp;gt;Hello</b>
catDOM/Manipulation
33

Object

NameValue
shortInsert any number of dynamically generated elements after each of the
matched elements.
params

Array

IndexValue
0

Object

NameValue
typeString
descA string of HTML, that will be created on the fly and appended to the target.
namehtml
descInsert any number of dynamically generated elements after each of the
matched elements.
tests

Array

IndexValue
0var expected = 'This is a normal link: Yahoobuga';

yahoo').after('<b>buga />ok( expected == $('#en').text(), 'Insert String after' );
typejQuery
nameafter
examples

Array

IndexValue
0

Object

NameValue
code;gt;Hello</b>");
result<p>I would like to say: amp;gt;Hello</b>
before<p>I would like to say: </p>
catDOM/Manipulation
34

Object

NameValue
shortInsert an element after each of the matched elements.
params

Array

IndexValue
0

Object

NameValue
typeElement
descA DOM element that will be appended.
nameelem
descInsert an element after each of the matched elements.
tests

Array

IndexValue
0var expected = "This is a normal link: YahooTry them out:";

/>ok( expected == $('#en').text(), "Insert element after" );
typejQuery
nameafter
examples

Array

IndexValue
0

Object

NameValue
code$("p").after( $("#foo")[0] );
result<p>I would like to say: </p><b amp;gt;Hello</b>
before<b t;/b><p>I would like to say: </p>
catDOM/Manipulation
35

Object

NameValue
shortInsert any number of elements after each of the matched elements.
params

Array

IndexValue
0

Object

NameValue
typeArray<Element>
descAn array of elements, all of which will be appended.
nameelems
descInsert any number of elements after each of the matched elements.
tests

Array

IndexValue
0var expected = "This is a normal link: YahooTry them out:diveintomark";
t.getElementById('mark')]);
/>ok( expected == $('#en').text(), "Insert array of elements after" );
typejQuery
nameafter
examples

Array

IndexValue
0

Object

NameValue
code$("p").after( $("b") );
result<p>I would like to say: amp;gt;Hello</b>
beforet;/b><p>I would like to say: </p>
catDOM/Manipulation
36

Object

NameValue
shortEnd the most recent 'destructive' operation, reverting the list of matched elements
back to its previous state.
params(empty Array)
descEnd the most recent 'destructive' operation, reverting the list of matched elements
back to its previous state. After an end operation, the list of matched elements will
revert to the last state of matched elements.
tests

Array

IndexValue
0ok( 'Yahoo' == yahoo').parent().end().text(), 'Check for end' );
typejQuery
nameend
examples

Array

IndexValue
0

Object

NameValue
code$("p").find("span").end();
result$("p").find("span").end() == [ p>...</p> ]
beforegt;Hello</span>,;lt;p><span>H how are you?</p>
catDOM/Traversing
37

Object

NameValue
shortSearches for all elements that match the specified expression.
params

Array

IndexValue
0

Object

NameValue
typeString
descAn expression to search with.
nameexpr
descSearches for all elements that match the specified expression.
This method is the optimal way of finding additional descendant
elements with which to process.

All searching is done using a jQuery expression. The expression can be
written using CSS 1-3 Selector syntax, or basic XPath.
tests

Array

IndexValue
0ok( 'Yahoo' == oo').find('.blogTest').text(), 'Check for find' );
typejQuery
namefind
examples

Array

IndexValue
0

Object

NameValue
code$("p").find("span");
result$("p").find("span") == [ ;gt;Hello</span> ]
beforegt;Hello</span>,;lt;p><span>H how are you?</p>
catDOM/Traversing
38

Object

NameValue
shortCreate cloned copies of all matched DOM Elements.
params(empty Array)
descCreate cloned copies of all matched DOM Elements. This does
not create a cloned copy of this particular jQuery object,
instead it creates duplicate copies of all DOM Elements.
This is useful for moving copies of the elements to another
location in the DOM.
tests

Array

IndexValue
0ok( 'This is a normal link: Yahoo' == $('#en').text(), 'Assert text for #en' );
var clone = $('#yahoo').clone();
ok( 'Try them out:Yahoo' == #first').append(clone).text(), 'Check for clone' );
ok( 'This is a normal link: Yahoo' == $('#en').text(), 'Reassert text for #en' );
typejQuery
nameclone
examples

Array

IndexValue
0

Object

NameValue
code$("b").clone().prependTo("p");
resultmp;gt;Hello</b>,t;<p><b>Hello</b>,b>Hello</b>&l how are you?</p>
beforet;/b><p>, how are you?</p>
catDOM/Manipulation
39

Object

NameValue
shortRemoves all elements from the set of matched elements that do not
match the specified expression.
params

Array

IndexValue
0

Object

NameValue
typeString
descAn expression to search with.
nameexpr
descRemoves all elements from the set of matched elements that do not
match the specified expression. This method is used to narrow down
the results of a search.

All searching is done using a jQuery expression. The expression
can be written using CSS 1-3 Selector syntax, or basic XPath.
tests

Array

IndexValue
0isSet( ut").filter(":checked").get(), q("radio2", "check1"), "Filter elements" );
1filter(":checked",function(i){
ok( this == q("radio2", "check1")[i], "Filter elements, context" );
});
2$("#main > p#ap > ",function(){},function(i){
/> ok( this == q("google","groups", "mark")[i], "Filter elements, else context" );
});
typejQuery
namefilter
examples

Array

IndexValue
0

Object

NameValue
code$("p").filter(".selected")
result$("p").filter(".selected") == [ <p amp;gt;Hello</p> ]
before<p /p><p>Howselected">Hello</p& are you?</p>
catDOM/Traversing
40

Object

NameValue
shortRemoves all elements from the set of matched elements that do not
match at least one of the expressions passed to the function.
params

Array

IndexValue
0

Object

NameValue
typeArray<String>
descA set of expressions to evaluate against
nameexprs
descRemoves all elements from the set of matched elements that do not
match at least one of the expressions passed to the function. This
method is used when you want to filter the set of matched elements
through more than one expression.

Elements will be retained in the jQuery object if they match at
least one of the expressions passed.
tests(empty Array)
typejQuery
namefilter
examples

Array

IndexValue
0

Object

NameValue
code$("p").filter([".selected", ":first"])
result$("p").filter([".selected", ":first"]) == [ mp;gt;Hello</p>, <p class="selected">And Again</p> ]
before><p>Hellomp;lt;p>Hello</p&a ain</p><p class="selected">And Again</p>
catDOM/Traversing
41

Object

NameValue
shortRemoves the specified Element from the set of matched elements.
params

Array

IndexValue
0

Object

NameValue
typeElement
descAn element to remove from the set
nameel
descRemoves the specified Element from the set of matched elements. This
method is used to remove a single Element from a jQuery object.
tests(empty Array)
typejQuery
namenot
examples

Array

IndexValue
0

Object

NameValue
code$("p").not( ent.getElementById("selected") )
result[ amp;gt;Hello</p> ]
beforello</p><p id="selected">Hello Again</p>
catDOM/Traversing
42

Object

NameValue
shortRemoves elements matching the specified expression from the set
of matched elements.
params

Array

IndexValue
0

Object

NameValue
typeString
descAn expression with which to remove matching elements
nameexpr
descRemoves elements matching the specified expression from the set
of matched elements. This method is used to remove one or more
elements from a jQuery object.
tests

Array

IndexValue
0ok($("#main > p#ap > a").not("#google").length == 2, ".not")
typejQuery
namenot
examples

Array

IndexValue
0

Object

NameValue
code$("p").not("#selected")
result[ amp;gt;Hello</p> ]
beforello</p><p id="selected">Hello Again</p>
catDOM/Traversing
43

Object

NameValue
shortAdds the elements matched by the expression to the jQuery object.
params

Array

IndexValue
0

Object

NameValue
typeString
descAn expression whose matched elements are added
nameexpr
descAdds the elements matched by the expression to the jQuery object. This
can be used to concatenate the result sets of two expressions.
tests(empty Array)
typejQuery
nameadd
examples

Array

IndexValue
0

Object

NameValue
code$("p").add("span")
result[ mp;gt;Hello</p>, <span>Hello Again</span> ]
beforep;gt;<span>Hello</p><p><span& span></p>
catDOM/Traversing
44

Object

NameValue
shortAdds each of the Elements in the array to the set of matched elements.
params

Array

IndexValue
0

Object

NameValue
typeArray<Element>
descAn array of Elements to add
nameels
descAdds each of the Elements in the array to the set of matched elements.
This is used to add a set of Elements to a jQuery object.
tests(empty Array)
typejQuery
nameadd
examples

Array

IndexValue
0

Object

NameValue
code[document.getElementById("a"), document.getElementById("b")])
result[ mp;gt;Hello</p>, <span id="a">Hello Again</span>, <span id="b">And Again</span> ]
before;<p><span>Hello</p>< id="a">Hello p;lt;/span><span id="b">And span></p>
catDOM/Traversing
45

Object

NameValue
shortAdds a single Element to the set of matched elements.
params

Array

IndexValue
0

Object

NameValue
typeElement
descAn Element to add
nameel
descAdds a single Element to the set of matched elements. This is used to
add a single Element to a jQuery object.
tests(empty Array)
typejQuery
nameadd
examples

Array

IndexValue
0

Object

NameValue
code$("p").add( document.getElementById("a") )
result[ mp;gt;Hello</p>, <span id="a">Hello Again</span> ]
before;<p><span>Hello</p>< id="a">Hello span></p>
catDOM/Traversing
46

Object

NameValue
shortChecks the current selection against an expression and returns true,
if the selection fits the given expression.
params

Array

IndexValue
0

Object

NameValue
typeString
descThe expression with which to filter
nameexpr
descChecks the current selection against an expression and returns true,
if the selection fits the given expression. Does return false, if the
selection does not fit or the expression is not valid.
tests

Array

IndexValue
0ok( $('#form').is('form'), 'Check for element: A form must be a form' );
ok( !$('#form').is('div'), 'Check for element: A form is not a div' );
ok( $('#mark').is('.blog'), 'Check for class: Expected class "blog"' );
ok( !$('#mark').is('.link'), 'Check for class: Did not expect class "link"' );
ok( $('#simon').is('.blog.link'), 'Check for multiple classes: Expected classes "blog" and "link"' );
ok( !$('#simon').is('.blogTest'), 'Check for multiple classes: Expected classes "blog" and "link", but not "blogTest"' );
ok( $('#en').is('[@lang="en"]'), 'Check for attribute: Expected attribute lang to be "en"' );
ok( !$('#en').is('[@lang="de"]'), 'Check for attribute: Expected attribute lang to be "en", not "de"' );
ok( #text1').is('[@type="text"]'), 'Check for attribute: Expected attribute type to be "text"' );
ok( text1').is('[@type="radio"]'), 'Check for attribute: Expected attribute type to be "text", not "radio"' );
ok( $('#text2').is(':disabled'), 'Check for pseudoclass: Expected to be disabled' );
ok( !$('#text1').is(':disabled'), 'Check for pseudoclass: Expected not disabled' );
ok( $('#radio2').is(':checked'), 'Check for pseudoclass: Expected to be checked' );
ok( !$('#radio1').is(':checked'), 'Check for pseudoclass: Expected not checked' );
ok( $('#foo').is('[p]'), 'Check for child: Expected a child "p" element' );
ok( !$('#foo').is('[ul]'), 'Check for child: Did not expect "ul" element' );
ok( $('#foo').is('[p][a][code]'), 'Check for childs: Expected "p", "a" and "code" child elements' );
ok( #foo').is('[p][a][code][ol]'), 'Check for childs: Expected "p", "a" and "code" child elements, but no "ol"' );
ok( !$('#foo').is(0), 'Expected false for an invalid expression - 0' );
ok( !$('#foo').is(null), 'Expected false for an invalid expression - null' );
ok( !$('#foo').is(''), 'Expected false for an invalid expression - ""' );
ok( !$('#foo').is(undefined), 'Expected false for an invalid expression - undefined' );
typeBoolean
nameis
examples

Array

IndexValue
0

Object

NameValue
descReturns true, because the parent of the input is a form element
beforep;lt;form><input type="checkbox" /></form>
codeeckbox']").parent().is("form")
resulttrue
1

Object

NameValue
descReturns false, because the parent of the input is a p element
before<p><input type="checkbox" p></form>
codeeckbox']").parent().is("form")
resultfalse
2

Object

NameValue
descAn invalid expression always returns false.
beforem></form>
code$("form").is(null)
resultfalse
catDOM/Traversing
47

Object

NameValue
catCore
typejQuery
desc
params

Array

IndexValue
0

Object

NameValue
typeArray
desc
nameargs
1

Object

NameValue
typeBoolean
desc
nametable
2

Object

NameValue
typeNumber
desc
nameint
3

Object

NameValue
typeFunction
descThe function doing the DOM manipulation.
namefn
short
examples(empty Array)
tests(empty Array)
private1
namedomManip
48

Object

NameValue
catCore
typejQuery
desc
params

Array

IndexValue
0

Object

NameValue
typeArray
desc
namea
1

Object

NameValue
typeArray
desc
nameargs
short
examples(empty Array)
tests(empty Array)
private1
namepushStack
49

Object

NameValue
catCore
typeObject
descExtends the jQuery object itself. Can be used to add both static
functions and plugin methods.
params

Array

IndexValue
0

Object

NameValue
typeObject
desc
nameobj
shortExtends the jQuery object itself.
examples

Array

IndexValue
0

Object

NameValue
descAdds two plugin methods.
code$.fn.extend({
check: function() {
this.each(function() { this.checked = true; });
),
uncheck: function() {
this.each(function() { this.checked = false; });
}
});
nput[@type=radio]").uncheck();
tests(empty Array)
private1
nameextend
50

Object

NameValue
shortExtend one object with another, returning the original,
modified, object.
params

Array

IndexValue
0

Object

NameValue
typeObject
descThe object to extend
nameobj
1

Object

NameValue
typeObject
descThe object that will be merged into the first.
nameprop
descExtend one object with another, returning the original,
modified, object. This is a great utility for simple inheritance.
tests

Array

IndexValue
0var settings = { xnumber1: 5, xnumber2: 7, xstring1: "peter", xstring2: "pan" };
var options = { xnumber2: 1, xstring2: "x", xxx: "newstring" };
var optionsCopy = { xnumber2: 1, xstring2: "x", xxx: "newstring" };
var merged = { xnumber1: 5, xnumber2: 1, xstring1: "peter", xstring2: "x", xxx: "newstring" };
jQuery.extend(settings, options);
isSet( settings, merged, "Check if extended: settings must be extended" );
isSet ( options, optionsCopy, "Check if not modified: options must not be modified" );
typeObject
name$.extend
examples

Array

IndexValue
0

Object

NameValue
codevar settings = { validate: false, limit: 5, name: "foo" };
var options = { validate: true, name: "bar" };
jQuery.extend(settings, options);
resultsettings == { validate: true, limit: 5, name: "bar" }
catJavascript
51

Object

NameValue
catCore
typeundefined
desc
params(empty Array)
short
examples(empty Array)
tests(empty Array)
private1
nameinit
52

Object

NameValue
shortA generic iterator function, which can be used to seemlessly
iterate over both objects and arrays.
params

Array

IndexValue
0

Object

NameValue
typeObject
descThe object, or array, to iterate over.
nameobj
1

Object

NameValue
typeFunction
descThe function that will be executed on every object.
namefn
descA generic iterator function, which can be used to seemlessly
iterate over both objects and arrays. This function is not the same
as $().each() - which is used to iterate, exclusively, over a jQuery
object. This function can be used to iterate over anything.
tests(empty Array)
typeObject
name$.each
examples

Array

IndexValue
0

Object

NameValue
descThis is an example of iterating over the items in an array, accessing both the current item and its index.
code$.each( [0,1,2], function(i){
alert( "Item #" + i + ": " + this );
});
1

Object

NameValue
descThis is an example of iterating over the properties in an Object, accessing both the current item and its key.
code$.each( { name: "John", lang: "JS" }, function(i){
alert( "Name: " + i + ", Value: " + this );
});
catJavascript
53

Object

NameValue
catCore
typeArray<Element>
desc
params(empty Array)
short
examples(empty Array)
tests

Array

IndexValue
0t( "Element Selector", "div", ["main","foo"] );
t( "Element Selector", "body", ["body"] );
t( "Element Selector", "html", ["html"] );
ok( $("*").size() >= 30, "Element Selector" );
t( "Parent Element", "div div", ["foo"] );

t( "ID Selector", "#body", ["body"] );
t( "ID Selector w/ Element", "body#body", ["body"] );
t( "ID Selector w/ Element", "ul#first", [] );

t( "Class Selector", ".blog", ["mark","simon"] );
t( "Class Selector", ".blog.link", ["simon"] );
t( "Class Selector w/ Element", "a.blog", ["mark","simon"] );
t( "Parent Class Selector", "p .blog", ["mark","simon"] );

t( "Comma Support", "a.blog, div", ["mark","simon","main","foo"] );
t( "Comma Support", "a.blog , div", ["mark","simon","main","foo"] );
t( "Comma Support", "a.blog ,div", ["mark","simon","main","foo"] );
t( "Comma Support", "a.blog,div", ["mark","simon","main","foo"] );

t( "Child", "p > a", roups","mark","yahoo","simon"] );
t( "Child", "p> a", roups","mark","yahoo","simon"] );
t( "Child", "p >a", roups","mark","yahoo","simon"] );
t( "Child", "p>a", roups","mark","yahoo","simon"] );
t( "Child w/ Class", "p > a.blog", ["mark","simon"] );
t( "All Children", "code > *", ["anchor1","anchor2"] );
t( "All Grandchildren", "p > * > *", ["anchor1","anchor2"] );
t( "Adjacent", "a + a", ["groups"] );
t( "Adjacent", "a +a", ["groups"] );
t( "Adjacent", "a+ a", ["groups"] );
t( "Adjacent", "a+a", ["groups"] );
t( "Adjacent", "p + p", ["ap","en","sap"] );
t( "Comma, Child, and Adjacent", "a + a, code > a", ["groups","anchor1","anchor2"] );
t( "First Child", "p:first-child", ["firstp","sndp"] );
t( "Attribute Exists", "a[@title]", ["google"] );
t( "Attribute Exists", "*[@title]", ["google"] );
t( "Attribute Exists", "[@title]", ["google"] );

t( "Non-existing part of attribute [@name*=bla]", "[@name*=bla]", [] );
t( "Non-existing start of attribute [@name^=bla]", "[@name^=bla]", [] );
t( "Non-existing end of attribute [@name$=bla]", "[@name$=bla]", [] );

t( "Attribute Equals", "a[@rel='bookmark']", ["simon1"] );
t( "Attribute Equals", 'a[@rel="bookmark"]', ["simon1"] );
t( "Attribute Equals", "a[@rel=bookmark]", ["simon1"] );
t( "Multiple Attribute Equals", idden'],input[@type='radio']", ["hidden1","radio1","radio2"] );
t( "Multiple Attribute Equals", dden\"],input[@type='radio']", ["hidden1","radio1","radio2"] );
t( "Multiple Attribute Equals", e=hidden],input[@type=radio]", ["hidden1","radio1","radio2"] );

t( "Attribute Begins With", "a[@href ^= 'http://www']", ["google","yahoo"] );
t( "Attribute Ends With", "a[@href $= 'org/']", ["mark"] );
t( "Attribute Contains", "a[@href *= 'google']", ["google","groups"] );
t( "First Child", "p:first-child", ["firstp","sndp"] );
t( "Last Child", "p:last-child", ["sap"] );
t( "Only Child", "a:only-child", ","anchor1","yahoo","anchor2"] );
t( "Empty", "ul:empty", ["firstUL"] );
t( "Enabled UI Element", "input:enabled", 2","hidden1","hidden2","name"]dio1","radio2","check1","check2","hidden1" );
t( "Disabled UI Element", "input:disabled", ["text2"] );
t( "Checked UI Element", "input:checked", ["radio2","check1"] );
t( "Selected Option Element", "option:selected", tion2d","option3b","option3c"] );
t( "Text Contains", "a:contains('Google')", ["google","groups"] );
t( "Text Contains", "a:contains('Google Groups')", ["groups"] );
t( "Element Preceded By", "p ~ div", ["foo"] );
t( "Not", "a.blog:not(.link)", ["mark"] );

ok( jQuery.find("//*").length >= 30, "All Elements (//*)" );
t( "All Div Elements", "//div", ["main","foo"] );
t( "Absolute Path", "/html/body", ["body"] );
t( "Absolute Path w/ *", "/* /body", ["body"] );
t( "Long Absolute Path", "/html/body/dl/div/div/p", ["sndp","en","sap"] );
t( "Absolute and Relative Paths", "/html//div", ["main","foo"] );
t( "All Children, Explicit", "//code/*", ["anchor1","anchor2"] );
t( "All Children, Implicit", "//code/", ["anchor1","anchor2"] );
t( "Attribute Exists", "//a[@title]", ["google"] );
t( "Attribute Equals", "//a[@rel='bookmark']", ["simon1"] );
t( "Parent Axis", "//p/..", ["main","foo"] );
t( "Sibling Axis", "//p/../", pty","form","sndp","en","sap"]p","foo","first","firstUL","empty","form", );
t( "Sibling Axis", "//p/../*", pty","form","sndp","en","sap"]p","foo","first","firstUL","empty","form", );
t( "Has Children", "//p[a]", ["firstp","ap","en","sap"] );

t( "nth Element", "p:nth(1)", ["ap"] );
t( "First Element", "p:first", ["firstp"] );
t( "Last Element", "p:last", ["first"] );
t( "Even Elements", "p:even", ["firstp","sndp","sap"] );
t( "Odd Elements", "p:odd", ["ap","en","first"] );
t( "Position Equals", "p:eq(1)", ["ap"] );
t( "Position Greater Than", "p:gt(0)", ap","sndp","en","sap","first"] );
t( "Position Less Than", "p:lt(3)", ["firstp","ap","sndp"] );
t( "Is A Parent", "p:parent", ap","sndp","en","sap","first"] );
t( "Is Visible", "input:visible", io2","check1","check2","name"] );
t( "Is Hidden", "input:hidden", ["hidden1","hidden2"] );

t( "Grouped Form Elements", "input[@name='foo[bar]']", ["hidden2"] );

t( "All Children of ID", "#foo/*", ["sndp", "en", "sap"] );
t( "All Children of ID with no children", "#firstUL/*", [] );

t( "Form element :input", ":input", ["text1", "text2", "radio1", "radio2", "check1", "check2", "hidden1", "hidden2", "name", "button", "area1", "select1", "select2", "select3"] );
t( "Form element :radio", ":radio", ["radio1", "radio2"] );
t( "Form element :checkbox", ":checkbox", ["check1", "check2"] );
t( "Form element :text", ":text", ["text1", "text2", "hidden2", "name"] );
t( "Form element :radio:checked", ":radio:checked", ["radio2"] );
t( "Form element :checkbox:checked", ":checkbox:checked", ["check1"] );
t( "Form element :checkbox:checked, :radio:checked", ":checkbox:checked, :radio:checked", ["check1", "radio2"] );

t( ":not() Existing attribute", "select:not([@multiple])", ["select1", "select2"]);
t( ":not() Equals attribute", "select:not([@name=select1])", ["select2", "select3"]);
t( ":not() Equals quoted attribute", elect:not([@name='select1'])", ["select2", "select3"]);
private1
name$.find
54

Object

NameValue
shortRemove the whitespace from the beginning and end of a string.
params

Array

IndexValue
0

Object

NameValue
typeString
descThe string to trim.
namestr
descRemove the whitespace from the beginning and end of a string.
tests(empty Array)
typeString
name$.trim
examples

Array

IndexValue
0

Object

NameValue
code$.trim(" hello, how are you? ");
result"hello, how are you?"
catJavascript
55

Object

NameValue
catDOM/Traversing
typeArray<Element>
descAll ancestors of a given element.
params

Array

IndexValue
0

Object

NameValue
typeElement
descThe element to find the ancestors of.
nameelem
shortAll ancestors of a given element.
examples(empty Array)
tests(empty Array)
private1
name$.parents
56

Object

NameValue
catDOM/Traversing
typeArray
descAll elements on a specified axis.
params

Array

IndexValue
0

Object

NameValue
typeElement
descThe element to find all the siblings of (including itself).
nameelem
shortAll elements on a specified axis.
examples(empty Array)
tests(empty Array)
private1
name$.sibling
57

Object

NameValue
shortMerge two arrays together, removing all duplicates.
params

Array

IndexValue
0

Object

NameValue
typeArray
descThe first array to merge.
namefirst
1

Object

NameValue
typeArray
descThe second array to merge.
namesecond
descMerge two arrays together, removing all duplicates. The final order
or the new array is: All the results from the first array, followed
by the unique results from the second array.
tests(empty Array)
typeArray
name$.merge
examples

Array

IndexValue
0

Object

NameValue
code$.merge( [0,1,2], [2,3,4] )
result[0,1,2,3,4]
1

Object

NameValue
code$.merge( [3,2,1], [4,3,2] )
result[3,2,1,4]
catJavascript
58

Object

NameValue
shortFilter items out of an array, by using a filter function.
params

Array

IndexValue
0

Object

NameValue
typeArray
descThe Array to find items in.
namearray
1

Object

NameValue
typeFunction
descThe function to process each item against.
namefn
2

Object

NameValue
typeBoolean
descInvert the selection - select the opposite of the function.
nameinv
descFilter items out of an array, by using a filter function.
The specified function will be passed two arguments: The
current array item and the index of the item in the array. The
function should return 'true' if you wish to keep the item in
the array, false if it should be removed.
tests(empty Array)
typeArray
name$.grep
examples

Array

IndexValue
0

Object

NameValue
code$.grep( [0,1,2], function(i){
return i > 0;
});
result[1, 2]
catJavascript
59

Object

NameValue
shortTranslate all items in an array to another array of items.
params

Array

IndexValue
0

Object

NameValue
typeArray
descThe Array to translate.
namearray
1

Object

NameValue
typeFunction
descThe function to process each item against.
namefn
descTranslate all items in an array to another array of items.
The translation function that is provided to this method is
called for each item in the array and is passed one argument:
The item to be translated. The function can then return:
The translated value, 'null' (to remove the item), or
an array of values - which will be flattened into the full array.
tests(empty Array)
typeArray
name$.map
examples

Array

IndexValue
0

Object

NameValue
code$.map( [0,1,2], function(i){
return i + 4;
});
result[4, 5, 6]
1

Object

NameValue
code$.map( [0,1,2], function(i){
return i > 0 ? i + 1 : null;
});
result[2, 3]
2

Object

NameValue
code$.map( [0,1,2], function(i){
return [ i, i + 1 ];
});
result[0, 1, 1, 2, 2, 3]
catJavascript
60

Object

NameValue
shortContains flags for the useragent, read from navigator.
params(empty Array)
descContains flags for the useragent, read from navigator.userAgent.
Available flags are: safari, opera, msie, mozilla
This property is available before the DOM is ready, therefore you can
use it to add ready events only for certain browsers.

See <a /jquery/jqbrowser/">
dwell.co.uk/geekery/javascript/jquery/jqbrowser/"& />jQBrowser plugin</a> for advanced browser detection:
tests(empty Array)
typeBoolean
name$.browser
examples

Array

IndexValue
0

Object

NameValue
descreturns true if the current useragent is some version of microsoft's internet explorer
code$.browser.msie
1

Object

NameValue
descAlerts "this is safari!" only for safari browsers
codeif($.browser.safari) { $( function() { alert("this is safari!"); } ); }
catJavascript
61

Object

NameValue
shortAppend all of the matched elements to another, specified, set of elements.
params

Array

IndexValue
0

Object

NameValue
typeString
descA jQuery expression of elements to match.
nameexpr
descAppend all of the matched elements to another, specified, set of elements.
This operation is, essentially, the reverse of doing a regular
$(A).append(B), in that instead of appending B to A, you're appending
A to B.
tests(empty Array)
typejQuery
nameappendTo
examples

Array

IndexValue
0

Object

NameValue
code$("p").appendTo("#foo");
result<div foo"><p>I would like to say: /p></div>
before<p>I would like to say: </p><div o"></div>
catDOM/Manipulation
62

Object

NameValue
shortPrepend all of the matched elements to another, specified, set of elements.
params

Array

IndexValue
0

Object

NameValue
typeString
descA jQuery expression of elements to match.
nameexpr
descPrepend all of the matched elements to another, specified, set of elements.
This operation is, essentially, the reverse of doing a regular
$(A).prepend(B), in that instead of prepending B to A, you're prepending
A to B.
tests(empty Array)
typejQuery
nameprependTo
examples

Array

IndexValue
0

Object

NameValue
code$("p").prependTo("#foo");
result<div foo"><p>I would like to say: /b></div><b>Hello</b><
before<p>I would like to say: </p><div /b></div><b>Hello</b>&l
catDOM/Manipulation
63

Object

NameValue
shortInsert all of the matched elements before another, specified, set of elements.
params

Array

IndexValue
0

Object

NameValue
typeString
descA jQuery expression of elements to match.
nameexpr
descInsert all of the matched elements before another, specified, set of elements.
This operation is, essentially, the reverse of doing a regular
$(A).before(B), in that instead of inserting B before A, you're inserting
A before B.
tests(empty Array)
typejQuery
nameinsertBefore
examples

Array

IndexValue
0

Object

NameValue
code$("p").insertBefore("#foo");
result<p>I would like to say: </p><div p;gt;Hello</div>
before<div /div><p>I would like to say: </p>
catDOM/Manipulation
64

Object

NameValue
shortInsert all of the matched elements after another, specified, set of elements.
params

Array

IndexValue
0

Object

NameValue
typeString
descA jQuery expression of elements to match.
nameexpr
descInsert all of the matched elements after another, specified, set of elements.
This operation is, essentially, the reverse of doing a regular
$(A).after(B), in that instead of inserting B after A, you're inserting
A after B.
tests(empty Array)
typejQuery
nameinsertAfter
examples

Array

IndexValue
0

Object

NameValue
code$("p").insertAfter("#foo");
result<div /div><p>I would like to say: </p>
before<p>I would like to say: </p><div p;gt;Hello</div>
catDOM/Manipulation
65

Object

NameValue
shortGet the current CSS width of the first matched element.
params(empty Array)
descGet the current CSS width of the first matched element.
tests(empty Array)
typeString
namewidth
examples

Array

IndexValue
0

Object

NameValue
code$("p").width();
result"300px"
before<p>This is just a test.</p>
catCSS
66

Object

NameValue
shortSet the CSS width of every matched element.
params

Array

IndexValue
0

Object

NameValue
typeString
descSet the CSS property to the specified value.
nameval
descSet the CSS width of every matched element. Be sure to include
the "px" (or other unit of measurement) after the number that you
specify, otherwise you might get strange results.
tests(empty Array)
typejQuery
namewidth
examples

Array

IndexValue
0

Object

NameValue
code$("p").width("20px");
result<p tyle="width:20px;">This is just a test.</p>
before<p>This is just a test.</p>
catCSS
67

Object

NameValue
shortGet the current CSS height of the first matched element.
params(empty Array)
descGet the current CSS height of the first matched element.
tests(empty Array)
typeString
nameheight
examples

Array

IndexValue
0

Object

NameValue
code$("p").height();
result"14px"
before<p>This is just a test.</p>
catCSS
68

Object

NameValue
shortSet the CSS height of every matched element.
params

Array

IndexValue
0

Object

NameValue
typeString
descSet the CSS property to the specified value.
nameval
descSet the CSS height of every matched element. Be sure to include
the "px" (or other unit of measurement) after the number that you
specify, otherwise you might get strange results.
tests(empty Array)
typejQuery
nameheight
examples

Array

IndexValue
0

Object

NameValue
code$("p").height("20px");
result<p yle="height:20px;">This is just a test.</p>
before<p>This is just a test.</p>
catCSS
69

Object

NameValue
shortGet the current CSS top of the first matched element.
params(empty Array)
descGet the current CSS top of the first matched element.
tests(empty Array)
typeString
nametop
examples

Array

IndexValue
0

Object

NameValue
code$("p").top();
result"0px"
before<p>This is just a test.</p>
catCSS
70

Object

NameValue
shortSet the CSS top of every matched element.
params

Array

IndexValue
0

Object

NameValue
typeString
descSet the CSS property to the specified value.
nameval
descSet the CSS top of every matched element. Be sure to include
the "px" (or other unit of measurement) after the number that you
specify, otherwise you might get strange results.
tests(empty Array)
typejQuery
nametop
examples

Array

IndexValue
0

Object

NameValue
code$("p").top("20px");
result<p style="top:20px;">This is just a test.</p>
before<p>This is just a test.</p>
catCSS
71

Object

NameValue
shortGet the current CSS left of the first matched element.
params(empty Array)
descGet the current CSS left of the first matched element.
tests(empty Array)
typeString
nameleft
examples

Array

IndexValue
0

Object

NameValue
code$("p").left();
result"0px"
before<p>This is just a test.</p>
catCSS
72

Object

NameValue
shortSet the CSS left of every matched element.
params

Array

IndexValue
0

Object

NameValue
typeString
descSet the CSS property to the specified value.
nameval
descSet the CSS left of every matched element. Be sure to include
the "px" (or other unit of measurement) after the number that you
specify, otherwise you might get strange results.
tests(empty Array)
typejQuery
nameleft
examples

Array

IndexValue
0

Object

NameValue
code$("p").left("20px");
result<p style="left:20px;">This is just a test.</p>
before<p>This is just a test.</p>
catCSS
73

Object

NameValue
shortGet the current CSS position of the first matched element.
params(empty Array)
descGet the current CSS position of the first matched element.
tests(empty Array)
typeString
nameposition
examples

Array

IndexValue
0

Object

NameValue
code$("p").position();
result"static"
before<p>This is just a test.</p>
catCSS
74

Object

NameValue
shortSet the CSS position of every matched element.
params

Array

IndexValue
0

Object

NameValue
typeString
descSet the CSS property to the specified value.
nameval
descSet the CSS position of every matched element.
tests(empty Array)
typejQuery
nameposition
examples

Array

IndexValue
0

Object

NameValue
code$("p").position("relative");
result<p osition:relative;">This is just a test.</p>
before<p>This is just a test.</p>
catCSS
75

Object

NameValue
shortGet the current CSS float of the first matched element.
params(empty Array)
descGet the current CSS float of the first matched element.
tests(empty Array)
typeString
namefloat
examples

Array

IndexValue
0

Object

NameValue
code$("p").float();
result"none"
before<p>This is just a test.</p>
catCSS
76

Object

NameValue
shortSet the CSS float of every matched element.
params

Array

IndexValue
0

Object

NameValue
typeString
descSet the CSS property to the specified value.
nameval
descSet the CSS float of every matched element.
tests(empty Array)
typejQuery
namefloat
examples

Array

IndexValue
0

Object

NameValue
code$("p").float("left");
result<p tyle="float:left;">This is just a test.</p>
before<p>This is just a test.</p>
catCSS
77

Object

NameValue
shortGet the current CSS overflow of the first matched element.
params(empty Array)
descGet the current CSS overflow of the first matched element.
tests(empty Array)
typeString
nameoverflow
examples

Array

IndexValue
0

Object

NameValue
code$("p").overflow();
result"none"
before<p>This is just a test.</p>
catCSS
78

Object

NameValue
shortSet the CSS overflow of every matched element.
params

Array

IndexValue
0

Object

NameValue
typeString
descSet the CSS property to the specified value.
nameval
descSet the CSS overflow of every matched element.
tests(empty Array)
typejQuery
nameoverflow
examples

Array

IndexValue
0

Object

NameValue
code$("p").overflow("auto");
result<p e="overflow:auto;">This is just a test.</p>
before<p>This is just a test.</p>
catCSS
79

Object

NameValue
shortGet the current CSS color of the first matched element.
params(empty Array)
descGet the current CSS color of the first matched element.
tests(empty Array)
typeString
namecolor
examples

Array

IndexValue
0

Object

NameValue
code$("p").color();
result"black"
before<p>This is just a test.</p>
catCSS
80

Object

NameValue
shortSet the CSS color of every matched element.
params

Array

IndexValue
0

Object

NameValue
typeString
descSet the CSS property to the specified value.
nameval
descSet the CSS color of every matched element.
tests(empty Array)
typejQuery
namecolor
examples

Array

IndexValue
0

Object

NameValue
code$("p").color("blue");
result<p tyle="color:blue;">This is just a test.</p>
before<p>This is just a test.</p>
catCSS
81

Object

NameValue
shortGet the current CSS background of the first matched element.
params(empty Array)
descGet the current CSS background of the first matched element.
tests(empty Array)
typeString
namebackground
examples

Array

IndexValue
0

Object

NameValue
code$("p").background();
result"blue"
before<p "background:blue;">This is just a test.</p>
catCSS
82

Object

NameValue
shortSet the CSS background of every matched element.
params

Array

IndexValue
0

Object

NameValue
typeString
descSet the CSS property to the specified value.
nameval
descSet the CSS background of every matched element.
tests(empty Array)
typejQuery
namebackground
examples

Array

IndexValue
0

Object

NameValue
code$("p").background("blue");
result<p "background:blue;">This is just a test.</p>
before<p>This is just a test.</p>
catCSS
83

Object

NameValue
shortReduce the set of matched elements to a single element.
params

Array

IndexValue
0

Object

NameValue
typeNumber
descThe index of the element that you wish to limit to.
namepos
descReduce the set of matched elements to a single element.
The position of the element in the set of matched elements
starts at 0 and goes to length - 1.
tests(empty Array)
typejQuery
nameeq
examples

Array

IndexValue
0

Object

NameValue
code$("p").eq(1)
result[ <p>So is this</p> ]
before<p>This is just a ;/p><p>So is this</p>
catCore
84

Object

NameValue
shortReduce the set of matched elements to all elements before a given position.
params

Array

IndexValue
0

Object

NameValue
typeNumber
descReduce the set to all elements below this position.
namepos
descReduce the set of matched elements to all elements before a given position.
The position of the element in the set of matched elements
starts at 0 and goes to length - 1.
tests(empty Array)
typejQuery
namelt
examples

Array

IndexValue
0

Object

NameValue
code$("p").lt(1)
result[ <p>This is just a test.</p> ]
before<p>This is just a ;/p><p>So is this</p>
catCore
85

Object

NameValue
shortReduce the set of matched elements to all elements after a given position.
params

Array

IndexValue
0

Object

NameValue
typeNumber
descReduce the set to all elements after this position.
namepos
descReduce the set of matched elements to all elements after a given position.
The position of the element in the set of matched elements
starts at 0 and goes to length - 1.
tests(empty Array)
typejQuery
namegt
examples

Array

IndexValue
0

Object

NameValue
code$("p").gt(0)
result[ <p>So is this</p> ]
before<p>This is just a ;/p><p>So is this</p>
catCore
86

Object

NameValue
shortFilter the set of elements to those that contain the specified text.
params

Array

IndexValue
0

Object

NameValue
typeString
descThe string that will be contained within the text of an element.
namestr
descFilter the set of elements to those that contain the specified text.
tests(empty Array)
typejQuery
namecontains
examples

Array

IndexValue
0

Object

NameValue
code$("p").contains("test")
result[ <p>This is just a test.</p> ]
before<p>This is just a ;/p><p>So is this</p>
catDOM/Traversing
87

Object

NameValue
shortGet the current value of the first matched element.
params(empty Array)
descGet the current value of the first matched element.
tests

Array

IndexValue
0ok( $("#text1").val() == "Test", "Check for value of input element" );
ok( !$("#text1").val() == "", "Check for value of input element" );
typeString
nameval
examples

Array

IndexValue
0

Object

NameValue
code$("input").val();
result"some text"
before<input type="text" value="some text"/>
catDOM/Attributes
88

Object

NameValue
shortSet the value of every matched element.
params

Array

IndexValue
0

Object

NameValue
typeString
descSet the property to the specified value.
nameval
descSet the value of every matched element.
tests

Array

IndexValue
0.getElementById('text1').value = "bla";
ok( $("#text1").val() == "bla", "Check for modified value of input element" );
$("#text1").val('test');
ok ( .getElementById('text1').value == "test", "Check for modified (via val(String)) value of input element" );
typejQuery
nameval
examples

Array

IndexValue
0

Object

NameValue
code$("input").value("test");
result<input type="text" value="test"/>
before<input type="text" value="some text"/>
catDOM/Attributes
89

Object

NameValue
shortGet the html contents of the first matched element.
params(empty Array)
descGet the html contents of the first matched element.
tests(empty Array)
typeString
namehtml
examples

Array

IndexValue
0

Object

NameValue
code$("div").html();
result<input/>
beforet/></div>amp;lt;div><input
catDOM/Attributes
90

Object

NameValue
shortSet the html contents of every matched element.
params

Array

IndexValue
0

Object

NameValue
typeString
descSet the html contents to the specified value.
nameval
descSet the html contents of every matched element.
tests

Array

IndexValue
0var div = $("div");

/>var pass = true;
for ( var i = 0; i < div.size(); i++ ) {
if ( div.get(i).childNodes.length == 0 ) pass = false;
}
ok( pass, "Set HTML" );
typejQuery
namehtml
examples

Array

IndexValue
0

Object

NameValue
codev").html("<b>new stuff</b>");
resultiv><b>new /b></div>
beforet/></div>amp;lt;div><input
catDOM/Attributes
91

Object

NameValue
shortGet the current id of the first matched element.
params(empty Array)
descGet the current id of the first matched element.
tests

Array

IndexValue
0ok( t.getElementById('main')).id() == "main", "Check for id" );
ok( $("#foo").id() == "foo", "Check for id" );
ok( !$("head").id(), "Check for id" );
typeString
nameid
examples

Array

IndexValue
0

Object

NameValue
code$("input").id();
result"test"
before<input type="text" id="test" value="some text"/>
catDOM/Attributes
92

Object

NameValue
shortSet the id of every matched element.
params

Array

IndexValue
0

Object

NameValue
typeString
descSet the property to the specified value.
nameval
descSet the id of every matched element.
tests(empty Array)
typejQuery
nameid
examples

Array

IndexValue
0

Object

NameValue
code$("input").id("newid");
result<input type="text" id="newid" value="some text"/>
before<input type="text" id="test" value="some text"/>
catDOM/Attributes
93

Object

NameValue
shortGet the current title of the first matched element.
params(empty Array)
descGet the current title of the first matched element.
tests

Array

IndexValue
0ok( ElementById('google')).title() == "Google!", "Check for title" );
ok( !$("#yahoo").title(), "Check for title" );
typeString
nametitle
examples

Array

IndexValue
0

Object

NameValue
code$("img").title();
result"my image"
before<img src="test.jpg" title="my image"/>
catDOM/Attributes
94

Object

NameValue
shortSet the title of every matched element.
params

Array

IndexValue
0

Object

NameValue
typeString
descSet the property to the specified value.
nameval
descSet the title of every matched element.
tests(empty Array)
typejQuery
nametitle
examples

Array

IndexValue
0

Object

NameValue
code$("img").title("new title");
result<img src="test.jpg" title="new image"/>
before<img src="test.jpg" title="my image"/>
catDOM/Attributes
95

Object

NameValue
shortGet the current name of the first matched element.
params(empty Array)
descGet the current name of the first matched element.
tests

Array

IndexValue
0ok( etElementById('text1')).name() == "action", "Check for name" );
ok( $("#hidden1").name() == "hidden", "Check for name" );
ok( !$("#area1").name(), "Check for name" );
typeString
namename
examples

Array

IndexValue
0

Object

NameValue
code$("input").name();
result"username"
before<input type="text" name="username"/>
catDOM/Attributes
96

Object

NameValue
shortSet the name of every matched element.
params

Array

IndexValue
0

Object

NameValue
typeString
descSet the property to the specified value.
nameval
descSet the name of every matched element.
tests(empty Array)
typejQuery
namename
examples

Array

IndexValue
0

Object

NameValue
code$("input").name("user");
result<input type="text" name="user"/>
before<input type="text" name="username"/>
catDOM/Attributes
97

Object

NameValue
shortGet the current href of the first matched element.
params(empty Array)
descGet the current href of the first matched element.
tests(empty Array)
typeString
namehref
examples

Array

IndexValue
0

Object

NameValue
code$("a").href();
result"test.html"
before<a href="test.html">my link</a>
catDOM/Attributes
98

Object

NameValue
shortSet the href of every matched element.
params

Array

IndexValue
0

Object

NameValue
typeString
descSet the property to the specified value.
nameval
descSet the href of every matched element.
tests(empty Array)
typejQuery
namehref
examples

Array

IndexValue
0

Object

NameValue
code$("a").href("test2.html");
result<a href="test2.html">my link</a>
before<a href="test.html">my link</a>
catDOM/Attributes
99

Object

NameValue
shortGet the current src of the first matched element.
params(empty Array)
descGet the current src of the first matched element.
tests(empty Array)
typeString
namesrc
examples

Array

IndexValue
0

Object

NameValue
code$("img").src();
result"test.jpg"
before<img src="test.jpg" title="my image"/>
catDOM/Attributes
100

Object

NameValue
shortSet the src of every matched element.
params

Array

IndexValue
0

Object

NameValue
typeString
descSet the property to the specified value.
nameval
descSet the src of every matched element.
tests(empty Array)
typejQuery
namesrc
examples

Array

IndexValue
0

Object

NameValue
code$("img").src("test2.jpg");
result<img src="test2.jpg" title="my image"/>
before<img src="test.jpg" title="my image"/>
catDOM/Attributes
101

Object

NameValue
shortGet the current rel of the first matched element.
params(empty Array)
descGet the current rel of the first matched element.
tests(empty Array)
typeString
namerel
examples

Array

IndexValue
0

Object

NameValue
code$("a").rel();
result"nofollow"
before<a href="test.html" rel="nofollow">my link</a>
catDOM/Attributes
102

Object

NameValue
shortSet the rel of every matched element.
params

Array

IndexValue
0

Object

NameValue
typeString
descSet the property to the specified value.
nameval
descSet the rel of every matched element.
tests(empty Array)
typejQuery
namerel
examples

Array

IndexValue
0

Object

NameValue
code$("a").rel("nofollow");
result<a href="test.html" rel="nofollow">my link</a>
before<a href="test.html">my link</a>
catDOM/Attributes
103

Object

NameValue
shortGet a set of elements containing the unique parents of the matched
set of elements.
params(empty Array)
descGet a set of elements containing the unique parents of the matched
set of elements.
tests(empty Array)
typejQuery
nameparent
examples

Array

IndexValue
0

Object

NameValue
code$("p").parent()
result[ /p></div><p>Hello</p></div>amp;gt;Hello</p><p>Hello&lt ]
before/p></div><p>Hello</p></div>amp;gt;Hello</p><p>Hello&lt
catDOM/Traversing
104

Object

NameValue
shortGet a set of elements containing the unique parents of the matched
set of elements, and filtered by an expression.
params

Array

IndexValue
0

Object

NameValue
typeString
descAn expression to filter the parents with
nameexpr
descGet a set of elements containing the unique parents of the matched
set of elements, and filtered by an expression.
tests(empty Array)
typejQuery
nameparent
examples

Array

IndexValue
0

Object

NameValue
code$("p").parent(".selected")
result[ <div ><p>Hello /p></div> ]
beforeamp;lt;/div><divmp;gt;Hello</p></div><div ><p>Hello /p></div>
catDOM/Traversing
105

Object

NameValue
shortGet a set of elements containing the unique ancestors of the matched
set of elements (except for the root element).
params(empty Array)
descGet a set of elements containing the unique ancestors of the matched
set of elements (except for the root element).
tests(empty Array)
typejQuery
nameancestors
examples

Array

IndexValue
0

Object

NameValue
code$("span").ancestors()
result[ p;gt;...</body>, mp;gt;...</div>, span></p>;lt;span>Hello</span></ ]
beforep;gt;<span>Hello;lt;/span></p><span>Hello;<span>Hello</span></p><span>Hellolt;div><p><span>Hello</span&gp;gt;<body><div>& y></html>mp;lt;/div></body></html&g
catDOM/Traversing
106

Object

NameValue
shortGet a set of elements containing the unique ancestors of the matched
set of elements, and filtered by an expression.
params

Array

IndexValue
0

Object

NameValue
typeString
descAn expression to filter the ancestors with
nameexpr
descGet a set of elements containing the unique ancestors of the matched
set of elements, and filtered by an expression.
tests(empty Array)
typejQuery
nameancestors
examples

Array

IndexValue
0

Object

NameValue
code$("span").ancestors("p")
result[ span></p>;lt;span>Hello</span></ ]
beforep;gt;<span>Hello;lt;/span></p><span>Hello;<span>Hello</span></p><span>Hellolt;div><p><span>Hello</span&gp;gt;<body><div>& y></html>mp;lt;/div></body></html&g
catDOM/Traversing
107

Object

NameValue
shortGet a set of elements containing the unique ancestors of the matched
set of elements (except for the root element).
params(empty Array)
descGet a set of elements containing the unique ancestors of the matched
set of elements (except for the root element).
tests(empty Array)
typejQuery
nameparents
examples

Array

IndexValue
0

Object

NameValue
code$("span").ancestors()
result[ p;gt;...</body>, mp;gt;...</div>, span></p>;lt;span>Hello</span></ ]
beforep;gt;<span>Hello;lt;/span></p><span>Hello;<span>Hello</span></p><span>Hellolt;div><p><span>Hello</span&gp;gt;<body><div>& y></html>mp;lt;/div></body></html&g
catDOM/Traversing
108

Object

NameValue
shortGet a set of elements containing the unique ancestors of the matched
set of elements, and filtered by an expression.
params

Array

IndexValue
0

Object

NameValue
typeString
descAn expression to filter the ancestors with
nameexpr
descGet a set of elements containing the unique ancestors of the matched
set of elements, and filtered by an expression.
tests(empty Array)
typejQuery
nameparents
examples

Array

IndexValue
0

Object

NameValue
code$("span").ancestors("p")
result[ span></p>;lt;span>Hello</span></ ]
beforep;gt;<span>Hello;lt;/span></p><span>Hello;<span>Hello</span></p><span>Hellolt;div><p><span>Hello</span&gp;gt;<body><div>& y></html>mp;lt;/div></body></html&g
catDOM/Traversing
109

Object

NameValue
shortGet a set of elements containing the unique next siblings of each of the
matched set of elements.
params(empty Array)
descGet a set of elements containing the unique next siblings of each of the
matched set of elements.

It only returns the very next sibling, not all next siblings.
tests(empty Array)
typejQuery
namenext
examples

Array

IndexValue
0

Object

NameValue
code$("p").next()
result[ <p>Hello Again</p>, amp;gt;<span>And an></div> ]
before><p>Hellomp;lt;p>Hello</p&a amp;gt;<span>And</p><div&g an></div>
catDOM/Traversing
110

Object

NameValue
shortGet a set of elements containing the unique next siblings of each of the
matched set of elements, and filtered by an expression.
params

Array

IndexValue
0

Object

NameValue
typeString
descAn expression to filter the next Elements with
nameexpr
descGet a set of elements containing the unique next siblings of each of the
matched set of elements, and filtered by an expression.

It only returns the very next sibling, not all next siblings.
tests(empty Array)
typejQuery
namenext
examples

Array

IndexValue
0

Object

NameValue
code$("p").next(".selected")
result[ <p class="selected">Hello Again</p> ]
beforello</p><p class="selected">Hello amp;gt;<span>And</p><div&g an></div>
catDOM/Traversing
111

Object

NameValue
shortGet a set of elements containing the unique previous siblings of each of the
matched set of elements.
params(empty Array)
descGet a set of elements containing the unique previous siblings of each of the
matched set of elements.

It only returns the immediately previous sibling, not all previous siblings.
tests(empty Array)
typejQuery
nameprev
examples

Array

IndexValue
0

Object

NameValue
code$("p").prev()
result[ p;gt;<span>Hello an></div> ]
beforep;gt;<span>Hellomp;lt;/p><div><span&gt iv><p>Andamp;lt;/span></div& Again</p>
catDOM/Traversing
112

Object

NameValue
shortGet a set of elements containing the unique previous siblings of each of the
matched set of elements, and filtered by an expression.
params

Array

IndexValue
0

Object

NameValue
typeString
descAn expression to filter the previous Elements with
nameexpr
descGet a set of elements containing the unique previous siblings of each of the
matched set of elements, and filtered by an expression.

It only returns the immediately previous sibling, not all previous siblings.
tests(empty Array)
typejQuery
nameprev
examples

Array

IndexValue
0

Object

NameValue
code$("p").previous(".selected")
result[ an></div>t;span>Hello</span></div&am ]
before;</div><pp;gt;Hello</span></div><p;lt;div><span&gt class="selected">Hello /p><p>And Again</p>
catDOM/Traversing
113

Object

NameValue
shortGet a set of elements containing all of the unique siblings of each of the
matched set of elements.
params(empty Array)
descGet a set of elements containing all of the unique siblings of each of the
matched set of elements.
tests

Array

IndexValue
0isSet( $("#en").siblings().get(), q("sndp", "sap"), "Check for siblings" );
typejQuery
namesiblings
examples

Array

IndexValue
0

Object

NameValue
code$("div").siblings()
result[ mp;gt;Hello</p>, <p>And Again</p> ]
beforep;gt;<span>Hellomp;lt;/p><div><span&gt iv><p>Andamp;lt;/span></div& Again</p>
catDOM/Traversing
114

Object

NameValue
shortGet a set of elements containing all of the unique siblings of each of the
matched set of elements, and filtered by an expression.
params

Array

IndexValue
0

Object

NameValue
typeString
descAn expression to filter the sibling Elements with
nameexpr
descGet a set of elements containing all of the unique siblings of each of the
matched set of elements, and filtered by an expression.
tests

Array

IndexValue
0isSet( dp").siblings("[code]").get(), q("sap"), "Check for filtered siblings (has code child element)" );
isSet( #sndp").siblings("[a]").get(), q("en", "sap"), "Check for filtered siblings (has anchor child element)" );
typejQuery
namesiblings
examples

Array

IndexValue
0

Object

NameValue
code$("div").siblings(".selected")
result[ <p class="selected">Hello Again</p> ]
before;</div><pp;gt;Hello</span></div><p;lt;div><span&gt class="selected">Hello /p><p>And Again</p>
catDOM/Traversing
115

Object

NameValue
shortGet a set of elements containing all of the unique children of each of the
matched set of elements.
params(empty Array)
descGet a set of elements containing all of the unique children of each of the
matched set of elements.
tests

Array

IndexValue
0isSet( $("#foo").children().get(), q("sndp", "en", "sap"), "Check for children" );
typejQuery
namechildren
examples

Array

IndexValue
0

Object

NameValue
code$("div").children()
result[ <span>Hello Again</span> ]
beforep;gt;<span>Hellomp;lt;/p><div><span&gt iv><p>Andamp;lt;/span></div& Again</p>
catDOM/Traversing
116

Object

NameValue
shortGet a set of elements containing all of the unique children of each of the
matched set of elements, and filtered by an expression.
params

Array

IndexValue
0

Object

NameValue
typeString
descAn expression to filter the child Elements with
nameexpr
descGet a set of elements containing all of the unique children of each of the
matched set of elements, and filtered by an expression.
tests

Array

IndexValue
0isSet( oo").children("[code]").get(), q("sndp", "sap"), "Check for filtered children" );
typejQuery
namechildren
examples

Array

IndexValue
0

Object

NameValue
code$("div").children(".selected")
result[ <p class="selected">Hello Again</p> ]
before</span><pp;gt;<span>Hello</span& class="selected">Hello /p><p>And /p></div>
catDOM/Traversing
117

Object

NameValue
shortRemove an attribute from each of the matched elements.
params

Array

IndexValue
0

Object

NameValue
typeString
descThe name of the attribute to remove.
namename
descRemove an attribute from each of the matched elements.
tests(empty Array)
typejQuery
nameremoveAttr
examples

Array

IndexValue
0

Object

NameValue
codeinput").removeAttr("disabled")
result<input/>
before<input disabled="disabled"/>
catDOM
118

Object

NameValue
shortDisplays each of the set of matched elements if they are hidden.
params(empty Array)
descDisplays each of the set of matched elements if they are hidden.
tests

Array

IndexValue
0var pass = true, div = $("div");

/> if ( this.style.display == "none" ) pass = false;
});
ok( pass, "Show" );
typejQuery
nameshow
examples

Array

IndexValue
0

Object

NameValue
code$("p").show()
result[ <p style="display: amp;gt;Hello</p> ]
before<p style="display: amp;gt;Hello</p>
catEffects
119

Object

NameValue
shortHides each of the set of matched elements if they are shown.
params(empty Array)
descHides each of the set of matched elements if they are shown.
tests(empty Array)
typejQuery
namehide
examples

Array

IndexValue
0

Object

NameValue
code$("p").hide()
result[ <p style="display: amp;gt;Hello</p> ]

var pass = true, div = $("div");

/> if ( this.style.display != "none" ) pass = false;
});
ok( pass, "Hide" );
beforeamp;gt;Hello</p>
catEffects
120

Object

NameValue
shortToggles each of the set of matched elements.
params(empty Array)
descToggles each of the set of matched elements. If they are shown,
toggle makes them hidden. If they are hidden, toggle
makes them shown.
tests(empty Array)
typejQuery
nametoggle
examples

Array

IndexValue
0

Object

NameValue
code$("p").toggle()
result[ <p style="display: mp;gt;Hello</p>, <p style="display: block">Hello Again</p> ]
beforello</p><p style="display: none">Hello Again</p>
catEffects
121

Object

NameValue
shortAdds the specified class to each of the set of matched elements.
params

Array

IndexValue
0

Object

NameValue
typeString
descA CSS class to add to the elements
nameclass
descAdds the specified class to each of the set of matched elements.
tests

Array

IndexValue
0var div = $("div");
div.addClass("test");
var pass = true;
for ( var i = 0; i < div.size(); i++ ) {
if ( t(i).className.indexOf("test") == -1 ) pass = false;
}
ok( pass, "Add Class" );
typejQuery
nameaddClass
examples

Array

IndexValue
0

Object

NameValue
code$("p").addClass("selected")
result[ <p amp;gt;Hello</p> ]
beforeamp;gt;Hello</p>
catDOM
122

Object

NameValue
shortRemoves the specified class from the set of matched elements.
params

Array

IndexValue
0

Object

NameValue
typeString
descA CSS class to remove from the elements
nameclass
descRemoves the specified class from the set of matched elements.
tests

Array

IndexValue
0var div = $("div").addClass("test");
div.removeClass("test");
var pass = true;
for ( var i = 0; i < div.size(); i++ ) {
if ( t(i).className.indexOf("test") != -1 ) pass = false;
}
ok( pass, "Remove Class" );

reset();

var div = ass("foo").addClass("bar");
("div").addClass("test").addCla ("bar").removeClass("foo");
emoveClass("test").removeClass("bar") />var pass = true;
for ( var i = 0; i < div.size(); i++ ) {
if ( lassName.match(/test|bar|foo/) ) pass = false;
}
ok( pass, "Remove multiple classes" );
typejQuery
nameremoveClass
examples

Array

IndexValue
0

Object

NameValue
code$("p").removeClass("selected")
result[ amp;gt;Hello</p> ]
before<p amp;gt;Hello</p>
catDOM
123

Object

NameValue
shortAdds the specified class if it is present, removes it if it is
not present.
params

Array

IndexValue
0

Object

NameValue
typeString
descA CSS class with which to toggle the elements
nameclass
descAdds the specified class if it is present, removes it if it is
not present.
tests(empty Array)
typejQuery
nametoggleClass
examples

Array

IndexValue
0

Object

NameValue
code$("p").toggleClass("selected")
result[ <p mp;gt;Hello</p>, <p>Hello Again</p> ]
beforello</p><p class="selected">Hello Again</p>
catDOM
124

Object

NameValue
shortRemoves all matched elements from the DOM.
params(empty Array)
descRemoves all matched elements from the DOM. This does NOT remove them from the
jQuery object, allowing you to use the matched elements further.
tests(empty Array)
typejQuery
nameremove
examples

Array

IndexValue
0

Object

NameValue
code$("p").remove();
resulthow are
beforeamp;gt;Hello</p> how are >you?</p>
catDOM/Manipulation
125

Object

NameValue
shortRemoves only elements (out of the list of matched elements) that match
the specified jQuery expression.
params

Array

IndexValue
0

Object

NameValue
typeString
descA jQuery expression to filter elements by.
nameexpr
descRemoves only elements (out of the list of matched elements) that match
the specified jQuery expression. This does NOT remove them from the
jQuery object, allowing you to use the matched elements further.
tests(empty Array)
typejQuery
nameremove
examples

Array

IndexValue
0

Object

NameValue
code$("p").remove(".hello");
resulthow are >you?</p>
before<p amp;gt;Hello</p> how are >you?</p>
catDOM/Manipulation
126

Object

NameValue
shortRemoves all child nodes from the set of matched elements.
params(empty Array)
descRemoves all child nodes from the set of matched elements.
tests(empty Array)
typejQuery
nameempty
examples

Array

IndexValue
0

Object

NameValue
code$("p").empty()
result[ lt;p></p> ]
before<p>Hello, gt;Person</span> <a href="#">and t;/a></p>
catDOM/Manipulation
127

Object

NameValue
shortBinds a handler to a particular event (like click) for each matched element.
params

Array

IndexValue
0

Object

NameValue
typeString
descAn event type
nametype
1

Object

NameValue
typeFunction
descA function to bind to the event on each of the set of matched elements
namefn
descBinds a handler to a particular event (like click) for each matched element.
The event handler is passed an event object that you can use to prevent
default behaviour. To stop both default action and event bubbling, your handler
has to return false.
tests(empty Array)
typejQuery
namebind
examples

Array

IndexValue
0

Object

NameValue
code$("p").bind( "click", function() {
alert( $(this).text() );
} )
resultalert("Hello")
beforeamp;gt;Hello</p>
1

Object

NameValue
descCancel a default action and prevent it from bubbling by returning false
from your function.
code$("form").bind( "submit", function() { return false; } )
2

Object

NameValue
descCancel only the default action by using the preventDefault method.
code$("form").bind( "submit", function(event) {
event.preventDefault();
} );
3

Object

NameValue
descStop only an event from bubbling by using the stopPropagation method.
code$("form").bind( "submit", function(event) {
event.stopPropagation();
} )
catEvents
128

Object

NameValue
shortThe opposite of bind, removes a bound event from each of the matched
elements.
params

Array

IndexValue
0

Object

NameValue
typeString
descAn event type
nametype
1

Object

NameValue
typeFunction
descA function to unbind from the event on each of the set of matched elements
namefn
descThe opposite of bind, removes a bound event from each of the matched
elements. You must pass the identical function that was used in the original
bind method.
tests(empty Array)
typejQuery
nameunbind
examples

Array

IndexValue
0

Object

NameValue
code$("p").unbind( "click", function() { alert("Hello"); } )
result[ amp;gt;Hello</p> ]
before<p amp;gt;Hello</p>
catEvents
129

Object

NameValue
shortRemoves all bound events of a particular type from each of the matched
elements.
params

Array

IndexValue
0

Object

NameValue
typeString
descAn event type
nametype
descRemoves all bound events of a particular type from each of the matched
elements.
tests(empty Array)
typejQuery
nameunbind
examples

Array

IndexValue
0

Object

NameValue
code$("p").unbind( "click" )
result[ amp;gt;Hello</p> ]
before<p amp;gt;Hello</p>
catEvents
130

Object

NameValue
shortRemoves all bound events from each of the matched elements.
params(empty Array)
descRemoves all bound events from each of the matched elements.
tests(empty Array)
typejQuery
nameunbind
examples

Array

IndexValue
0

Object

NameValue
code$("p").unbind()
result[ amp;gt;Hello</p> ]
before<p amp;gt;Hello</p>
catEvents
131

Object

NameValue
shortTrigger a type of event on every matched element.
params

Array

IndexValue
0

Object

NameValue
typeString
descAn event type to trigger.
nametype
descTrigger a type of event on every matched element.
tests(empty Array)
typejQuery
nametrigger
examples

Array

IndexValue
0

Object

NameValue
code$("p").trigger("click")
resultalert('hello')
before<p amp;gt;Hello</p>
catEvents
132

Object

NameValue
shortToggle between two function calls every other click.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descThe function to execute on every even click.
nameeven
1

Object

NameValue
typeFunction
descThe function to execute on every odd click.
nameodd
descToggle between two function calls every other click.
Whenever a matched element is clicked, the first specified function
is fired, when clicked again, the second is fired. All subsequent
clicks continue to rotate through the two functions.
tests

Array

IndexValue
0var count = 0;
var fn1 = function() { count++; }
var fn2 = function() { count--; }
var link = $('#mark');
link.click().toggle(fn1, ().click().click().click();
/>ok( count == 1, "Check for toggle(fn, fn)" );
typejQuery
nametoggle
examples

Array

IndexValue
0

Object

NameValue
code$("p").toggle(function(){
this).addClass("selected");
/>},function(){
s).removeClass("selected");
/>});
catEvents
133

Object

NameValue
shortA method for simulating hovering (moving the mouse on, and off,
an object).
params

Array

IndexValue
0

Object

NameValue
typeFunction
descThe function to fire whenever the mouse is moved over a matched element.
nameover
1

Object

NameValue
typeFunction
descThe function to fire whenever the mouse is moved off of a matched element.
nameout
descA method for simulating hovering (moving the mouse on, and off,
an object). This is a custom method which provides an 'in' to a
frequent task.

Whenever the mouse cursor is moved over a matched
element, the first specified function is fired. Whenever the mouse
moves off of the element, the second specified function fires.
Additionally, checks are in place to see if the mouse is still within
the specified element itself (for example, an image inside of a div),
and if it is, it will continue to 'hover', and not move out
(a common error in using a mouseout event handler).
tests(empty Array)
typejQuery
namehover
examples

Array

IndexValue
0

Object

NameValue
code$("p").hover(function(){
$(this).addClass("over");
},function(){
$(this).addClass("out");
});
catEvents
134

Object

NameValue
shortBind a function to be executed whenever the DOM is ready to be
traversed and manipulated.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descThe function to be executed when the DOM is ready.
namefn
descBind a function to be executed whenever the DOM is ready to be
traversed and manipulated. This is probably the most important
function included in the event module, as it can greatly improve
the response times of your web applications.

In a nutshell, this is a solid replacement for using window.onload,
and attaching a function to that. By using this method, your bound Function
will be called the instant the DOM is ready to be read and manipulated,
which is exactly what 99.99% of all Javascript code needs to run.

Please ensure you have no code in your <body> onload event handler,
otherwise $(document).ready() may not fire.

You can have as many $(document).ready events on your page as you like.
tests(empty Array)
typejQuery
nameready
examples

Array

IndexValue
0

Object

NameValue
code$(document).ready(function(){ Your code here... });
catEvents
135

Object

NameValue
shortBind a function to the scroll event of each matched element.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descA function to bind to the scroll event on each of the matched elements.
namefn
descBind a function to the scroll event of each matched element.
tests(empty Array)
typejQuery
namescroll
examples

Array

IndexValue
0

Object

NameValue
code$("p").scroll( function() { alert("Hello"); } );
result<p amp;gt;Hello</p>
beforeamp;gt;Hello</p>
catEvents/Browser
136

Object

NameValue
shortTrigger the scroll event of each matched element.
params(empty Array)
descTrigger the scroll event of each matched element. This causes all of the functions
that have been bound to thet scroll event to be executed.
tests(empty Array)
typejQuery
namescroll
examples

Array

IndexValue
0

Object

NameValue
code$("p").scroll();
resultalert('Hello');
before<p amp;gt;Hello</p>
catEvents/Browser
137

Object

NameValue
shortBind a function to the scroll event of each matched element, which will only be executed once.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descA function to bind to the scroll event on each of the matched elements.
namefn
descBind a function to the scroll event of each matched element, which will only be executed once.
Unlike a call to the normal .scroll() method, calling .onescroll() causes the bound function to be
only executed the first time it is triggered, and never again (unless it is re-bound).
tests(empty Array)
typejQuery
nameonescroll
examples

Array

IndexValue
0

Object

NameValue
code$("p").onescroll( function() { alert("Hello"); } );
resultalert('Hello'); // Only executed for the first scroll
before<p amp;gt;Hello</p>
catEvents/Browser
138

Object

NameValue
shortRemoves a bound scroll event from each of the matched
elements.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descA function to unbind from the scroll event on each of the matched elements.
namefn
descRemoves a bound scroll event from each of the matched
elements. You must pass the identical function that was used in the original
bind method.
tests(empty Array)
typejQuery
nameunscroll
examples

Array

IndexValue
0

Object

NameValue
code$("p").unscroll( myFunction );
resultamp;gt;Hello</p>
before<p amp;gt;Hello</p>
catEvents/Browser
139

Object

NameValue
shortRemoves all bound scroll events from each of the matched elements.
params(empty Array)
descRemoves all bound scroll events from each of the matched elements.
tests(empty Array)
typejQuery
nameunscroll
examples

Array

IndexValue
0

Object

NameValue
code$("p").unscroll();
resultamp;gt;Hello</p>
before<p amp;gt;Hello</p>
catEvents/Browser
140

Object

NameValue
shortBind a function to the submit event of each matched element.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descA function to bind to the submit event on each of the matched elements.
namefn
descBind a function to the submit event of each matched element.
tests(empty Array)
typejQuery
namesubmit
examples

Array

IndexValue
0

Object

NameValue
code$("p").submit( function() { alert("Hello"); } );
result<p amp;gt;Hello</p>
beforeamp;gt;Hello</p>
catEvents/Form
141

Object

NameValue
shortTrigger the submit event of each matched element.
params(empty Array)
descTrigger the submit event of each matched element. This causes all of the functions
that have been bound to thet submit event to be executed.
tests(empty Array)
typejQuery
namesubmit
examples

Array

IndexValue
0

Object

NameValue
code$("p").submit();
resultalert('Hello');
before<p amp;gt;Hello</p>
catEvents/Form
142

Object

NameValue
shortBind a function to the submit event of each matched element, which will only be executed once.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descA function to bind to the submit event on each of the matched elements.
namefn
descBind a function to the submit event of each matched element, which will only be executed once.
Unlike a call to the normal .submit() method, calling .onesubmit() causes the bound function to be
only executed the first time it is triggered, and never again (unless it is re-bound).
tests(empty Array)
typejQuery
nameonesubmit
examples

Array

IndexValue
0

Object

NameValue
code$("p").onesubmit( function() { alert("Hello"); } );
resultalert('Hello'); // Only executed for the first submit
before<p amp;gt;Hello</p>
catEvents/Form
143

Object

NameValue
shortRemoves a bound submit event from each of the matched
elements.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descA function to unbind from the submit event on each of the matched elements.
namefn
descRemoves a bound submit event from each of the matched
elements. You must pass the identical function that was used in the original
bind method.
tests(empty Array)
typejQuery
nameunsubmit
examples

Array

IndexValue
0

Object

NameValue
code$("p").unsubmit( myFunction );
resultamp;gt;Hello</p>
before<p amp;gt;Hello</p>
catEvents/Form
144

Object

NameValue
shortRemoves all bound submit events from each of the matched elements.
params(empty Array)
descRemoves all bound submit events from each of the matched elements.
tests(empty Array)
typejQuery
nameunsubmit
examples

Array

IndexValue
0

Object

NameValue
code$("p").unsubmit();
resultamp;gt;Hello</p>
before<p amp;gt;Hello</p>
catEvents/Form
145

Object

NameValue
shortBind a function to the focus event of each matched element.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descA function to bind to the focus event on each of the matched elements.
namefn
descBind a function to the focus event of each matched element.
tests(empty Array)
typejQuery
namefocus
examples

Array

IndexValue
0

Object

NameValue
code$("p").focus( function() { alert("Hello"); } );
result<p amp;gt;Hello</p>
beforeamp;gt;Hello</p>
catEvents/UI
146

Object

NameValue
shortTrigger the focus event of each matched element.
params(empty Array)
descTrigger the focus event of each matched element. This causes all of the functions
that have been bound to thet focus event to be executed.
tests(empty Array)
typejQuery
namefocus
examples

Array

IndexValue
0

Object

NameValue
code$("p").focus();
resultalert('Hello');
before<p amp;gt;Hello</p>
catEvents/UI
147

Object

NameValue
shortBind a function to the focus event of each matched element, which will only be executed once.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descA function to bind to the focus event on each of the matched elements.
namefn
descBind a function to the focus event of each matched element, which will only be executed once.
Unlike a call to the normal .focus() method, calling .onefocus() causes the bound function to be
only executed the first time it is triggered, and never again (unless it is re-bound).
tests(empty Array)
typejQuery
nameonefocus
examples

Array

IndexValue
0

Object

NameValue
code$("p").onefocus( function() { alert("Hello"); } );
resultalert('Hello'); // Only executed for the first focus
before<p amp;gt;Hello</p>
catEvents/UI
148

Object

NameValue
shortRemoves a bound focus event from each of the matched
elements.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descA function to unbind from the focus event on each of the matched elements.
namefn
descRemoves a bound focus event from each of the matched
elements. You must pass the identical function that was used in the original
bind method.
tests(empty Array)
typejQuery
nameunfocus
examples

Array

IndexValue
0

Object

NameValue
code$("p").unfocus( myFunction );
resultamp;gt;Hello</p>
before<p amp;gt;Hello</p>
catEvents/UI
149

Object

NameValue
shortRemoves all bound focus events from each of the matched elements.
params(empty Array)
descRemoves all bound focus events from each of the matched elements.
tests(empty Array)
typejQuery
nameunfocus
examples

Array

IndexValue
0

Object

NameValue
code$("p").unfocus();
resultamp;gt;Hello</p>
before<p amp;gt;Hello</p>
catEvents/UI
150

Object

NameValue
shortBind a function to the keydown event of each matched element.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descA function to bind to the keydown event on each of the matched elements.
namefn
descBind a function to the keydown event of each matched element.
tests(empty Array)
typejQuery
namekeydown
examples

Array

IndexValue
0

Object

NameValue
code$("p").keydown( function() { alert("Hello"); } );
result<p amp;gt;Hello</p>
beforeamp;gt;Hello</p>
catEvents/Keyboard
151

Object

NameValue
shortTrigger the keydown event of each matched element.
params(empty Array)
descTrigger the keydown event of each matched element. This causes all of the functions
that have been bound to thet keydown event to be executed.
tests(empty Array)
typejQuery
namekeydown
examples

Array

IndexValue
0

Object

NameValue
code$("p").keydown();
resultalert('Hello');
before<p amp;gt;Hello</p>
catEvents/Keyboard
152

Object

NameValue
shortBind a function to the keydown event of each matched element, which will only be executed once.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descA function to bind to the keydown event on each of the matched elements.
namefn
descBind a function to the keydown event of each matched element, which will only be executed once.
Unlike a call to the normal .keydown() method, calling .onekeydown() causes the bound function to be
only executed the first time it is triggered, and never again (unless it is re-bound).
tests(empty Array)
typejQuery
nameonekeydown
examples

Array

IndexValue
0

Object

NameValue
code$("p").onekeydown( function() { alert("Hello"); } );
resultalert('Hello'); // Only executed for the first keydown
before<p amp;gt;Hello</p>
catEvents/Keyboard
153

Object

NameValue
shortRemoves a bound keydown event from each of the matched
elements.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descA function to unbind from the keydown event on each of the matched elements.
namefn
descRemoves a bound keydown event from each of the matched
elements. You must pass the identical function that was used in the original
bind method.
tests(empty Array)
typejQuery
nameunkeydown
examples

Array

IndexValue
0

Object

NameValue
code$("p").unkeydown( myFunction );
resultamp;gt;Hello</p>
before<p amp;gt;Hello</p>
catEvents/Keyboard
154

Object

NameValue
shortRemoves all bound keydown events from each of the matched elements.
params(empty Array)
descRemoves all bound keydown events from each of the matched elements.
tests(empty Array)
typejQuery
nameunkeydown
examples

Array

IndexValue
0

Object

NameValue
code$("p").unkeydown();
resultamp;gt;Hello</p>
before<p amp;gt;Hello</p>
catEvents/Keyboard
155

Object

NameValue
shortBind a function to the dblclick event of each matched element.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descA function to bind to the dblclick event on each of the matched elements.
namefn
descBind a function to the dblclick event of each matched element.
tests(empty Array)
typejQuery
namedblclick
examples

Array

IndexValue
0

Object

NameValue
code$("p").dblclick( function() { alert("Hello"); } );
result<p amp;gt;Hello</p>
beforeamp;gt;Hello</p>
catEvents/Mouse
156

Object

NameValue
shortTrigger the dblclick event of each matched element.
params(empty Array)
descTrigger the dblclick event of each matched element. This causes all of the functions
that have been bound to thet dblclick event to be executed.
tests(empty Array)
typejQuery
namedblclick
examples

Array

IndexValue
0

Object

NameValue
code$("p").dblclick();
resultalert('Hello');
before<p amp;gt;Hello</p>
catEvents/Mouse
157

Object

NameValue
shortBind a function to the dblclick event of each matched element, which will only be executed once.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descA function to bind to the dblclick event on each of the matched elements.
namefn
descBind a function to the dblclick event of each matched element, which will only be executed once.
Unlike a call to the normal .dblclick() method, calling .onedblclick() causes the bound function to be
only executed the first time it is triggered, and never again (unless it is re-bound).
tests(empty Array)
typejQuery
nameonedblclick
examples

Array

IndexValue
0

Object

NameValue
code$("p").onedblclick( function() { alert("Hello"); } );
resultalert('Hello'); // Only executed for the first dblclick
before<p amp;gt;Hello</p>
catEvents/Mouse
158

Object

NameValue
shortRemoves a bound dblclick event from each of the matched
elements.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descA function to unbind from the dblclick event on each of the matched elements.
namefn
descRemoves a bound dblclick event from each of the matched
elements. You must pass the identical function that was used in the original
bind method.
tests(empty Array)
typejQuery
nameundblclick
examples

Array

IndexValue
0

Object

NameValue
code$("p").undblclick( myFunction );
resultamp;gt;Hello</p>
before<p amp;gt;Hello</p>
catEvents/Mouse
159

Object

NameValue
shortRemoves all bound dblclick events from each of the matched elements.
params(empty Array)
descRemoves all bound dblclick events from each of the matched elements.
tests(empty Array)
typejQuery
nameundblclick
examples

Array

IndexValue
0

Object

NameValue
code$("p").undblclick();
resultamp;gt;Hello</p>
before<p amp;gt;Hello</p>
catEvents/Mouse
160

Object

NameValue
shortBind a function to the keypress event of each matched element.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descA function to bind to the keypress event on each of the matched elements.
namefn
descBind a function to the keypress event of each matched element.
tests(empty Array)
typejQuery
namekeypress
examples

Array

IndexValue
0

Object

NameValue
code$("p").keypress( function() { alert("Hello"); } );
result<p amp;gt;Hello</p>
beforeamp;gt;Hello</p>
catEvents/Keyboard
161

Object

NameValue
shortTrigger the keypress event of each matched element.
params(empty Array)
descTrigger the keypress event of each matched element. This causes all of the functions
that have been bound to thet keypress event to be executed.
tests(empty Array)
typejQuery
namekeypress
examples

Array

IndexValue
0

Object

NameValue
code$("p").keypress();
resultalert('Hello');
before<p amp;gt;Hello</p>
catEvents/Keyboard
162

Object

NameValue
shortBind a function to the keypress event of each matched element, which will only be executed once.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descA function to bind to the keypress event on each of the matched elements.
namefn
descBind a function to the keypress event of each matched element, which will only be executed once.
Unlike a call to the normal .keypress() method, calling .onekeypress() causes the bound function to be
only executed the first time it is triggered, and never again (unless it is re-bound).
tests(empty Array)
typejQuery
nameonekeypress
examples

Array

IndexValue
0

Object

NameValue
code$("p").onekeypress( function() { alert("Hello"); } );
resultalert('Hello'); // Only executed for the first keypress
before<p amp;gt;Hello</p>
catEvents/Keyboard
163

Object

NameValue
shortRemoves a bound keypress event from each of the matched
elements.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descA function to unbind from the keypress event on each of the matched elements.
namefn
descRemoves a bound keypress event from each of the matched
elements. You must pass the identical function that was used in the original
bind method.
tests(empty Array)
typejQuery
nameunkeypress
examples

Array

IndexValue
0

Object

NameValue
code$("p").unkeypress( myFunction );
resultamp;gt;Hello</p>
before<p amp;gt;Hello</p>
catEvents/Keyboard
164

Object

NameValue
shortRemoves all bound keypress events from each of the matched elements.
params(empty Array)
descRemoves all bound keypress events from each of the matched elements.
tests(empty Array)
typejQuery
nameunkeypress
examples

Array

IndexValue
0

Object

NameValue
code$("p").unkeypress();
resultamp;gt;Hello</p>
before<p amp;gt;Hello</p>
catEvents/Keyboard
165

Object

NameValue
shortBind a function to the error event of each matched element.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descA function to bind to the error event on each of the matched elements.
namefn
descBind a function to the error event of each matched element.
tests(empty Array)
typejQuery
nameerror
examples

Array

IndexValue
0

Object

NameValue
code$("p").error( function() { alert("Hello"); } );
result<p amp;gt;Hello</p>
beforeamp;gt;Hello</p>
catEvents/Browser
166

Object

NameValue
shortTrigger the error event of each matched element.
params(empty Array)
descTrigger the error event of each matched element. This causes all of the functions
that have been bound to thet error event to be executed.
tests(empty Array)
typejQuery
nameerror
examples

Array

IndexValue
0

Object

NameValue
code$("p").error();
resultalert('Hello');
before<p amp;gt;Hello</p>
catEvents/Browser
167

Object

NameValue
shortBind a function to the error event of each matched element, which will only be executed once.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descA function to bind to the error event on each of the matched elements.
namefn
descBind a function to the error event of each matched element, which will only be executed once.
Unlike a call to the normal .error() method, calling .oneerror() causes the bound function to be
only executed the first time it is triggered, and never again (unless it is re-bound).
tests(empty Array)
typejQuery
nameoneerror
examples

Array

IndexValue
0

Object

NameValue
code$("p").oneerror( function() { alert("Hello"); } );
resultalert('Hello'); // Only executed for the first error
before<p amp;gt;Hello</p>
catEvents/Browser
168

Object

NameValue
shortRemoves a bound error event from each of the matched
elements.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descA function to unbind from the error event on each of the matched elements.
namefn
descRemoves a bound error event from each of the matched
elements. You must pass the identical function that was used in the original
bind method.
tests(empty Array)
typejQuery
nameunerror
examples

Array

IndexValue
0

Object

NameValue
code$("p").unerror( myFunction );
resultamp;gt;Hello</p>
before<p amp;gt;Hello</p>
catEvents/Browser
169

Object

NameValue
shortRemoves all bound error events from each of the matched elements.
params(empty Array)
descRemoves all bound error events from each of the matched elements.
tests(empty Array)
typejQuery
nameunerror
examples

Array

IndexValue
0

Object

NameValue
code$("p").unerror();
resultamp;gt;Hello</p>
before<p amp;gt;Hello</p>
catEvents/Browser
170

Object

NameValue
shortBind a function to the blur event of each matched element.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descA function to bind to the blur event on each of the matched elements.
namefn
descBind a function to the blur event of each matched element.
tests(empty Array)
typejQuery
nameblur
examples

Array

IndexValue
0

Object

NameValue
code$("p").blur( function() { alert("Hello"); } );
result<p amp;gt;Hello</p>
beforeamp;gt;Hello</p>
catEvents/UI
171

Object

NameValue
shortTrigger the blur event of each matched element.
params(empty Array)
descTrigger the blur event of each matched element. This causes all of the functions
that have been bound to thet blur event to be executed.
tests(empty Array)
typejQuery
nameblur
examples

Array

IndexValue
0

Object

NameValue
code$("p").blur();
resultalert('Hello');
before<p amp;gt;Hello</p>
catEvents/UI
172

Object

NameValue
shortBind a function to the blur event of each matched element, which will only be executed once.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descA function to bind to the blur event on each of the matched elements.
namefn
descBind a function to the blur event of each matched element, which will only be executed once.
Unlike a call to the normal .blur() method, calling .oneblur() causes the bound function to be
only executed the first time it is triggered, and never again (unless it is re-bound).
tests(empty Array)
typejQuery
nameoneblur
examples

Array

IndexValue
0

Object

NameValue
code$("p").oneblur( function() { alert("Hello"); } );
resultalert('Hello'); // Only executed for the first blur
before<p amp;gt;Hello</p>
catEvents/UI
173

Object

NameValue
shortRemoves a bound blur event from each of the matched
elements.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descA function to unbind from the blur event on each of the matched elements.
namefn
descRemoves a bound blur event from each of the matched
elements. You must pass the identical function that was used in the original
bind method.
tests(empty Array)
typejQuery
nameunblur
examples

Array

IndexValue
0

Object

NameValue
code$("p").unblur( myFunction );
resultamp;gt;Hello</p>
before<p amp;gt;Hello</p>
catEvents/UI
174

Object

NameValue
shortRemoves all bound blur events from each of the matched elements.
params(empty Array)
descRemoves all bound blur events from each of the matched elements.
tests(empty Array)
typejQuery
nameunblur
examples

Array

IndexValue
0

Object

NameValue
code$("p").unblur();
resultamp;gt;Hello</p>
before<p amp;gt;Hello</p>
catEvents/UI
175

Object

NameValue
shortBind a function to the load event of each matched element.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descA function to bind to the load event on each of the matched elements.
namefn
descBind a function to the load event of each matched element.
tests(empty Array)
typejQuery
nameload
examples

Array

IndexValue
0

Object

NameValue
code$("p").load( function() { alert("Hello"); } );
result<p amp;gt;Hello</p>
beforeamp;gt;Hello</p>
catEvents/Browser
176

Object

NameValue
catEvents/Browser
typejQuery
descTrigger the load event of each matched element. This causes all of the functions
that have been bound to thet load event to be executed.

Marked as private: Calling load() without arguments throws exception because the ajax load
does not handle it.
params(empty Array)
shortTrigger the load event of each matched element.
examples

Array

IndexValue
0

Object

NameValue
code$("p").load();
resultalert('Hello');
before<p amp;gt;Hello</p>
tests(empty Array)
private1
nameload
177

Object

NameValue
shortBind a function to the load event of each matched element, which will only be executed once.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descA function to bind to the load event on each of the matched elements.
namefn
descBind a function to the load event of each matched element, which will only be executed once.
Unlike a call to the normal .load() method, calling .oneload() causes the bound function to be
only executed the first time it is triggered, and never again (unless it is re-bound).
tests(empty Array)
typejQuery
nameoneload
examples

Array

IndexValue
0

Object

NameValue
code$("p").oneload( function() { alert("Hello"); } );
resultalert('Hello'); // Only executed for the first load
before<p amp;gt;Hello</p>
catEvents/Browser
178

Object

NameValue
shortRemoves a bound load event from each of the matched
elements.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descA function to unbind from the load event on each of the matched elements.
namefn
descRemoves a bound load event from each of the matched
elements. You must pass the identical function that was used in the original
bind method.
tests(empty Array)
typejQuery
nameunload
examples

Array

IndexValue
0

Object

NameValue
code$("p").unload( myFunction );
resultamp;gt;Hello</p>
before<p amp;gt;Hello</p>
catEvents/Browser
179

Object

NameValue
shortRemoves all bound load events from each of the matched elements.
params(empty Array)
descRemoves all bound load events from each of the matched elements.
tests(empty Array)
typejQuery
nameunload
examples

Array

IndexValue
0

Object

NameValue
code$("p").unload();
resultamp;gt;Hello</p>
before<p amp;gt;Hello</p>
catEvents/Browser
180

Object

NameValue
shortBind a function to the select event of each matched element.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descA function to bind to the select event on each of the matched elements.
namefn
descBind a function to the select event of each matched element.
tests(empty Array)
typejQuery
nameselect
examples

Array

IndexValue
0

Object

NameValue
code$("p").select( function() { alert("Hello"); } );
result<p amp;gt;Hello</p>
beforeamp;gt;Hello</p>
catEvents/Form
181

Object

NameValue
shortTrigger the select event of each matched element.
params(empty Array)
descTrigger the select event of each matched element. This causes all of the functions
that have been bound to thet select event to be executed.
tests(empty Array)
typejQuery
nameselect
examples

Array

IndexValue
0

Object

NameValue
code$("p").select();
resultalert('Hello');
before<p amp;gt;Hello</p>
catEvents/Form
182

Object

NameValue
shortBind a function to the select event of each matched element, which will only be executed once.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descA function to bind to the select event on each of the matched elements.
namefn
descBind a function to the select event of each matched element, which will only be executed once.
Unlike a call to the normal .select() method, calling .oneselect() causes the bound function to be
only executed the first time it is triggered, and never again (unless it is re-bound).
tests(empty Array)
typejQuery
nameoneselect
examples

Array

IndexValue
0

Object

NameValue
code$("p").oneselect( function() { alert("Hello"); } );
resultalert('Hello'); // Only executed for the first select
before<p amp;gt;Hello</p>
catEvents/Form
183

Object

NameValue
shortRemoves a bound select event from each of the matched
elements.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descA function to unbind from the select event on each of the matched elements.
namefn
descRemoves a bound select event from each of the matched
elements. You must pass the identical function that was used in the original
bind method.
tests(empty Array)
typejQuery
nameunselect
examples

Array

IndexValue
0

Object

NameValue
code$("p").unselect( myFunction );
resultamp;gt;Hello</p>
before<p amp;gt;Hello</p>
catEvents/Form
184

Object

NameValue
shortRemoves all bound select events from each of the matched elements.
params(empty Array)
descRemoves all bound select events from each of the matched elements.
tests(empty Array)
typejQuery
nameunselect
examples

Array

IndexValue
0

Object

NameValue
code$("p").unselect();
resultamp;gt;Hello</p>
before<p amp;gt;Hello</p>
catEvents/Form
185

Object

NameValue
shortBind a function to the mouseup event of each matched element.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descA function to bind to the mouseup event on each of the matched elements.
namefn
descBind a function to the mouseup event of each matched element.
tests(empty Array)
typejQuery
namemouseup
examples

Array

IndexValue
0

Object

NameValue
code$("p").mouseup( function() { alert("Hello"); } );
result<p amp;gt;Hello</p>
beforeamp;gt;Hello</p>
catEvents/Mouse
186

Object

NameValue
shortTrigger the mouseup event of each matched element.
params(empty Array)
descTrigger the mouseup event of each matched element. This causes all of the functions
that have been bound to thet mouseup event to be executed.
tests(empty Array)
typejQuery
namemouseup
examples

Array

IndexValue
0

Object

NameValue
code$("p").mouseup();
resultalert('Hello');
before<p amp;gt;Hello</p>
catEvents/Mouse
187

Object

NameValue
shortBind a function to the mouseup event of each matched element, which will only be executed once.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descA function to bind to the mouseup event on each of the matched elements.
namefn
descBind a function to the mouseup event of each matched element, which will only be executed once.
Unlike a call to the normal .mouseup() method, calling .onemouseup() causes the bound function to be
only executed the first time it is triggered, and never again (unless it is re-bound).
tests(empty Array)
typejQuery
nameonemouseup
examples

Array

IndexValue
0

Object

NameValue
code$("p").onemouseup( function() { alert("Hello"); } );
resultalert('Hello'); // Only executed for the first mouseup
before<p amp;gt;Hello</p>
catEvents/Mouse
188

Object

NameValue
shortRemoves a bound mouseup event from each of the matched
elements.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descA function to unbind from the mouseup event on each of the matched elements.
namefn
descRemoves a bound mouseup event from each of the matched
elements. You must pass the identical function that was used in the original
bind method.
tests(empty Array)
typejQuery
nameunmouseup
examples

Array

IndexValue
0

Object

NameValue
code$("p").unmouseup( myFunction );
resultamp;gt;Hello</p>
before<p amp;gt;Hello</p>
catEvents/Mouse
189

Object

NameValue
shortRemoves all bound mouseup events from each of the matched elements.
params(empty Array)
descRemoves all bound mouseup events from each of the matched elements.
tests(empty Array)
typejQuery
nameunmouseup
examples

Array

IndexValue
0

Object

NameValue
code$("p").unmouseup();
resultamp;gt;Hello</p>
before<p amp;gt;Hello</p>
catEvents/Mouse
190

Object

NameValue
shortBind a function to the unload event of each matched element.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descA function to bind to the unload event on each of the matched elements.
namefn
descBind a function to the unload event of each matched element.
tests(empty Array)
typejQuery
nameunload
examples

Array

IndexValue
0

Object

NameValue
code$("p").unload( function() { alert("Hello"); } );
result<p amp;gt;Hello</p>
beforeamp;gt;Hello</p>
catEvents/Browser
191

Object

NameValue
shortTrigger the unload event of each matched element.
params(empty Array)
descTrigger the unload event of each matched element. This causes all of the functions
that have been bound to thet unload event to be executed.
tests(empty Array)
typejQuery
nameunload
examples

Array

IndexValue
0

Object

NameValue
code$("p").unload();
resultalert('Hello');
before<p amp;gt;Hello</p>
catEvents/Browser
192

Object

NameValue
shortBind a function to the unload event of each matched element, which will only be executed once.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descA function to bind to the unload event on each of the matched elements.
namefn
descBind a function to the unload event of each matched element, which will only be executed once.
Unlike a call to the normal .unload() method, calling .oneunload() causes the bound function to be
only executed the first time it is triggered, and never again (unless it is re-bound).
tests(empty Array)
typejQuery
nameoneunload
examples

Array

IndexValue
0

Object

NameValue
code$("p").oneunload( function() { alert("Hello"); } );
resultalert('Hello'); // Only executed for the first unload
before<p amp;gt;Hello</p>
catEvents/Browser
193

Object

NameValue
shortRemoves a bound unload event from each of the matched
elements.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descA function to unbind from the unload event on each of the matched elements.
namefn
descRemoves a bound unload event from each of the matched
elements. You must pass the identical function that was used in the original
bind method.
tests(empty Array)
typejQuery
nameununload
examples

Array

IndexValue
0

Object

NameValue
code$("p").ununload( myFunction );
resultamp;gt;Hello</p>
before<p amp;gt;Hello</p>
catEvents/Browser
194

Object

NameValue
shortRemoves all bound unload events from each of the matched elements.
params(empty Array)
descRemoves all bound unload events from each of the matched elements.
tests(empty Array)
typejQuery
nameununload
examples

Array

IndexValue
0

Object

NameValue
code$("p").ununload();
resultamp;gt;Hello</p>
before<p amp;gt;Hello</p>
catEvents/Browser
195

Object

NameValue
shortBind a function to the change event of each matched element.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descA function to bind to the change event on each of the matched elements.
namefn
descBind a function to the change event of each matched element.
tests(empty Array)
typejQuery
namechange
examples

Array

IndexValue
0

Object

NameValue
code$("p").change( function() { alert("Hello"); } );
result<p amp;gt;Hello</p>
beforeamp;gt;Hello</p>
catEvents/Form
196

Object

NameValue
shortTrigger the change event of each matched element.
params(empty Array)
descTrigger the change event of each matched element. This causes all of the functions
that have been bound to thet change event to be executed.
tests(empty Array)
typejQuery
namechange
examples

Array

IndexValue
0

Object

NameValue
code$("p").change();
resultalert('Hello');
before<p amp;gt;Hello</p>
catEvents/Form
197

Object

NameValue
shortBind a function to the change event of each matched element, which will only be executed once.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descA function to bind to the change event on each of the matched elements.
namefn
descBind a function to the change event of each matched element, which will only be executed once.
Unlike a call to the normal .change() method, calling .onechange() causes the bound function to be
only executed the first time it is triggered, and never again (unless it is re-bound).
tests(empty Array)
typejQuery
nameonechange
examples

Array

IndexValue
0

Object

NameValue
code$("p").onechange( function() { alert("Hello"); } );
resultalert('Hello'); // Only executed for the first change
before<p amp;gt;Hello</p>
catEvents/Form
198

Object

NameValue
shortRemoves a bound change event from each of the matched
elements.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descA function to unbind from the change event on each of the matched elements.
namefn
descRemoves a bound change event from each of the matched
elements. You must pass the identical function that was used in the original
bind method.
tests(empty Array)
typejQuery
nameunchange
examples

Array

IndexValue
0

Object

NameValue
code$("p").unchange( myFunction );
resultamp;gt;Hello</p>
before<p amp;gt;Hello</p>
catEvents/Form
199

Object

NameValue
shortRemoves all bound change events from each of the matched elements.
params(empty Array)
descRemoves all bound change events from each of the matched elements.
tests(empty Array)
typejQuery
nameunchange
examples

Array

IndexValue
0

Object

NameValue
code$("p").unchange();
resultamp;gt;Hello</p>
before<p amp;gt;Hello</p>
catEvents/Form
200

Object

NameValue
shortBind a function to the mouseout event of each matched element.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descA function to bind to the mouseout event on each of the matched elements.
namefn
descBind a function to the mouseout event of each matched element.
tests(empty Array)
typejQuery
namemouseout
examples

Array

IndexValue
0

Object

NameValue
code$("p").mouseout( function() { alert("Hello"); } );
result<p amp;gt;Hello</p>
beforeamp;gt;Hello</p>
catEvents/Mouse
201

Object

NameValue
shortTrigger the mouseout event of each matched element.
params(empty Array)
descTrigger the mouseout event of each matched element. This causes all of the functions
that have been bound to thet mouseout event to be executed.
tests(empty Array)
typejQuery
namemouseout
examples

Array

IndexValue
0

Object

NameValue
code$("p").mouseout();
resultalert('Hello');
before<p amp;gt;Hello</p>
catEvents/Mouse
202

Object

NameValue
shortBind a function to the mouseout event of each matched element, which will only be executed once.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descA function to bind to the mouseout event on each of the matched elements.
namefn
descBind a function to the mouseout event of each matched element, which will only be executed once.
Unlike a call to the normal .mouseout() method, calling .onemouseout() causes the bound function to be
only executed the first time it is triggered, and never again (unless it is re-bound).
tests(empty Array)
typejQuery
nameonemouseout
examples

Array

IndexValue
0

Object

NameValue
code$("p").onemouseout( function() { alert("Hello"); } );
resultalert('Hello'); // Only executed for the first mouseout
before<p amp;gt;Hello</p>
catEvents/Mouse
203

Object

NameValue
shortRemoves a bound mouseout event from each of the matched
elements.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descA function to unbind from the mouseout event on each of the matched elements.
namefn
descRemoves a bound mouseout event from each of the matched
elements. You must pass the identical function that was used in the original
bind method.
tests(empty Array)
typejQuery
nameunmouseout
examples

Array

IndexValue
0

Object

NameValue
code$("p").unmouseout( myFunction );
resultamp;gt;Hello</p>
before<p amp;gt;Hello</p>
catEvents/Mouse
204

Object

NameValue
shortRemoves all bound mouseout events from each of the matched elements.
params(empty Array)
descRemoves all bound mouseout events from each of the matched elements.
tests(empty Array)
typejQuery
nameunmouseout
examples

Array

IndexValue
0

Object

NameValue
code$("p").unmouseout();
resultamp;gt;Hello</p>
before<p amp;gt;Hello</p>
catEvents/Mouse
205

Object

NameValue
shortBind a function to the keyup event of each matched element.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descA function to bind to the keyup event on each of the matched elements.
namefn
descBind a function to the keyup event of each matched element.
tests(empty Array)
typejQuery
namekeyup
examples

Array

IndexValue
0

Object

NameValue
code$("p").keyup( function() { alert("Hello"); } );
result<p amp;gt;Hello</p>
beforeamp;gt;Hello</p>
catEvents/Keyboard
206

Object

NameValue
shortTrigger the keyup event of each matched element.
params(empty Array)
descTrigger the keyup event of each matched element. This causes all of the functions
that have been bound to thet keyup event to be executed.
tests(empty Array)
typejQuery
namekeyup
examples

Array

IndexValue
0

Object

NameValue
code$("p").keyup();
resultalert('Hello');
before<p amp;gt;Hello</p>
catEvents/Keyboard
207

Object

NameValue
shortBind a function to the keyup event of each matched element, which will only be executed once.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descA function to bind to the keyup event on each of the matched elements.
namefn
descBind a function to the keyup event of each matched element, which will only be executed once.
Unlike a call to the normal .keyup() method, calling .onekeyup() causes the bound function to be
only executed the first time it is triggered, and never again (unless it is re-bound).
tests(empty Array)
typejQuery
nameonekeyup
examples

Array

IndexValue
0

Object

NameValue
code$("p").onekeyup( function() { alert("Hello"); } );
resultalert('Hello'); // Only executed for the first keyup
before<p amp;gt;Hello</p>
catEvents/Keyboard
208

Object

NameValue
shortRemoves a bound keyup event from each of the matched
elements.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descA function to unbind from the keyup event on each of the matched elements.
namefn
descRemoves a bound keyup event from each of the matched
elements. You must pass the identical function that was used in the original
bind method.
tests(empty Array)
typejQuery
nameunkeyup
examples

Array

IndexValue
0

Object

NameValue
code$("p").unkeyup( myFunction );
resultamp;gt;Hello</p>
before<p amp;gt;Hello</p>
catEvents/Keyboard
209

Object

NameValue
shortRemoves all bound keyup events from each of the matched elements.
params(empty Array)
descRemoves all bound keyup events from each of the matched elements.
tests(empty Array)
typejQuery
nameunkeyup
examples

Array

IndexValue
0

Object

NameValue
code$("p").unkeyup();
resultamp;gt;Hello</p>
before<p amp;gt;Hello</p>
catEvents/Keyboard
210

Object

NameValue
shortBind a function to the click event of each matched element.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descA function to bind to the click event on each of the matched elements.
namefn
descBind a function to the click event of each matched element.
tests(empty Array)
typejQuery
nameclick
examples

Array

IndexValue
0

Object

NameValue
code$("p").click( function() { alert("Hello"); } );
result<p amp;gt;Hello</p>
beforeamp;gt;Hello</p>
catEvents/Mouse
211

Object

NameValue
shortTrigger the click event of each matched element.
params(empty Array)
descTrigger the click event of each matched element. This causes all of the functions
that have been bound to thet click event to be executed.
tests(empty Array)
typejQuery
nameclick
examples

Array

IndexValue
0

Object

NameValue
code$("p").click();
resultalert('Hello');
before<p amp;gt;Hello</p>
catEvents/Mouse
212

Object

NameValue
shortBind a function to the click event of each matched element, which will only be executed once.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descA function to bind to the click event on each of the matched elements.
namefn
descBind a function to the click event of each matched element, which will only be executed once.
Unlike a call to the normal .click() method, calling .oneclick() causes the bound function to be
only executed the first time it is triggered, and never again (unless it is re-bound).
tests(empty Array)
typejQuery
nameoneclick
examples

Array

IndexValue
0

Object

NameValue
code$("p").oneclick( function() { alert("Hello"); } );
resultalert('Hello'); // Only executed for the first click
before<p amp;gt;Hello</p>
catEvents/Mouse
213

Object

NameValue
shortRemoves a bound click event from each of the matched
elements.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descA function to unbind from the click event on each of the matched elements.
namefn
descRemoves a bound click event from each of the matched
elements. You must pass the identical function that was used in the original
bind method.
tests(empty Array)
typejQuery
nameunclick
examples

Array

IndexValue
0

Object

NameValue
code$("p").unclick( myFunction );
resultamp;gt;Hello</p>
before<p amp;gt;Hello</p>
catEvents/Mouse
214

Object

NameValue
shortRemoves all bound click events from each of the matched elements.
params(empty Array)
descRemoves all bound click events from each of the matched elements.
tests(empty Array)
typejQuery
nameunclick
examples

Array

IndexValue
0

Object

NameValue
code$("p").unclick();
resultamp;gt;Hello</p>
before<p amp;gt;Hello</p>
catEvents/Mouse
215

Object

NameValue
shortBind a function to the resize event of each matched element.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descA function to bind to the resize event on each of the matched elements.
namefn
descBind a function to the resize event of each matched element.
tests(empty Array)
typejQuery
nameresize
examples

Array

IndexValue
0

Object

NameValue
code$("p").resize( function() { alert("Hello"); } );
result<p amp;gt;Hello</p>
beforeamp;gt;Hello</p>
catEvents/Browser
216

Object

NameValue
shortTrigger the resize event of each matched element.
params(empty Array)
descTrigger the resize event of each matched element. This causes all of the functions
that have been bound to thet resize event to be executed.
tests(empty Array)
typejQuery
nameresize
examples

Array

IndexValue
0

Object

NameValue
code$("p").resize();
resultalert('Hello');
before<p amp;gt;Hello</p>
catEvents/Browser
217

Object

NameValue
shortBind a function to the resize event of each matched element, which will only be executed once.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descA function to bind to the resize event on each of the matched elements.
namefn
descBind a function to the resize event of each matched element, which will only be executed once.
Unlike a call to the normal .resize() method, calling .oneresize() causes the bound function to be
only executed the first time it is triggered, and never again (unless it is re-bound).
tests(empty Array)
typejQuery
nameoneresize
examples

Array

IndexValue
0

Object

NameValue
code$("p").oneresize( function() { alert("Hello"); } );
resultalert('Hello'); // Only executed for the first resize
before<p amp;gt;Hello</p>
catEvents/Browser
218

Object

NameValue
shortRemoves a bound resize event from each of the matched
elements.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descA function to unbind from the resize event on each of the matched elements.
namefn
descRemoves a bound resize event from each of the matched
elements. You must pass the identical function that was used in the original
bind method.
tests(empty Array)
typejQuery
nameunresize
examples

Array

IndexValue
0

Object

NameValue
code$("p").unresize( myFunction );
resultamp;gt;Hello</p>
before<p amp;gt;Hello</p>
catEvents/Browser
219

Object

NameValue
shortRemoves all bound resize events from each of the matched elements.
params(empty Array)
descRemoves all bound resize events from each of the matched elements.
tests(empty Array)
typejQuery
nameunresize
examples

Array

IndexValue
0

Object

NameValue
code$("p").unresize();
resultamp;gt;Hello</p>
before<p amp;gt;Hello</p>
catEvents/Browser
220

Object

NameValue
shortBind a function to the mousemove event of each matched element.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descA function to bind to the mousemove event on each of the matched elements.
namefn
descBind a function to the mousemove event of each matched element.
tests(empty Array)
typejQuery
namemousemove
examples

Array

IndexValue
0

Object

NameValue
code$("p").mousemove( function() { alert("Hello"); } );
result<p amp;gt;Hello</p>
beforeamp;gt;Hello</p>
catEvents/Mouse
221

Object

NameValue
shortTrigger the mousemove event of each matched element.
params(empty Array)
descTrigger the mousemove event of each matched element. This causes all of the functions
that have been bound to thet mousemove event to be executed.
tests(empty Array)
typejQuery
namemousemove
examples

Array

IndexValue
0

Object

NameValue
code$("p").mousemove();
resultalert('Hello');
before<p amp;gt;Hello</p>
catEvents/Mouse
222

Object

NameValue
shortBind a function to the mousemove event of each matched element, which will only be executed once.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descA function to bind to the mousemove event on each of the matched elements.
namefn
descBind a function to the mousemove event of each matched element, which will only be executed once.
Unlike a call to the normal .mousemove() method, calling .onemousemove() causes the bound function to be
only executed the first time it is triggered, and never again (unless it is re-bound).
tests(empty Array)
typejQuery
nameonemousemove
examples

Array

IndexValue
0

Object

NameValue
code$("p").onemousemove( function() { alert("Hello"); } );
resultalert('Hello'); // Only executed for the first mousemove
before<p amp;gt;Hello</p>
catEvents/Mouse
223

Object

NameValue
shortRemoves a bound mousemove event from each of the matched
elements.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descA function to unbind from the mousemove event on each of the matched elements.
namefn
descRemoves a bound mousemove event from each of the matched
elements. You must pass the identical function that was used in the original
bind method.
tests(empty Array)
typejQuery
nameunmousemove
examples

Array

IndexValue
0

Object

NameValue
code$("p").unmousemove( myFunction );
resultamp;gt;Hello</p>
before<p amp;gt;Hello</p>
catEvents/Mouse
224

Object

NameValue
shortRemoves all bound mousemove events from each of the matched elements.
params(empty Array)
descRemoves all bound mousemove events from each of the matched elements.
tests(empty Array)
typejQuery
nameunmousemove
examples

Array

IndexValue
0

Object

NameValue
code$("p").unmousemove();
resultamp;gt;Hello</p>
before<p amp;gt;Hello</p>
catEvents/Mouse
225

Object

NameValue
shortBind a function to the mousedown event of each matched element.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descA function to bind to the mousedown event on each of the matched elements.
namefn
descBind a function to the mousedown event of each matched element.
tests(empty Array)
typejQuery
namemousedown
examples

Array

IndexValue
0

Object

NameValue
code$("p").mousedown( function() { alert("Hello"); } );
result<p amp;gt;Hello</p>
beforeamp;gt;Hello</p>
catEvents/Mouse
226

Object

NameValue
shortTrigger the mousedown event of each matched element.
params(empty Array)
descTrigger the mousedown event of each matched element. This causes all of the functions
that have been bound to thet mousedown event to be executed.
tests(empty Array)
typejQuery
namemousedown
examples

Array

IndexValue
0

Object

NameValue
code$("p").mousedown();
resultalert('Hello');
before<p amp;gt;Hello</p>
catEvents/Mouse
227

Object

NameValue
shortBind a function to the mousedown event of each matched element, which will only be executed once.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descA function to bind to the mousedown event on each of the matched elements.
namefn
descBind a function to the mousedown event of each matched element, which will only be executed once.
Unlike a call to the normal .mousedown() method, calling .onemousedown() causes the bound function to be
only executed the first time it is triggered, and never again (unless it is re-bound).
tests(empty Array)
typejQuery
nameonemousedown
examples

Array

IndexValue
0

Object

NameValue
code$("p").onemousedown( function() { alert("Hello"); } );
resultalert('Hello'); // Only executed for the first mousedown
before<p amp;gt;Hello</p>
catEvents/Mouse
228

Object

NameValue
shortRemoves a bound mousedown event from each of the matched
elements.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descA function to unbind from the mousedown event on each of the matched elements.
namefn
descRemoves a bound mousedown event from each of the matched
elements. You must pass the identical function that was used in the original
bind method.
tests(empty Array)
typejQuery
nameunmousedown
examples

Array

IndexValue
0

Object

NameValue
code$("p").unmousedown( myFunction );
resultamp;gt;Hello</p>
before<p amp;gt;Hello</p>
catEvents/Mouse
229

Object

NameValue
shortRemoves all bound mousedown events from each of the matched elements.
params(empty Array)
descRemoves all bound mousedown events from each of the matched elements.
tests(empty Array)
typejQuery
nameunmousedown
examples

Array

IndexValue
0

Object

NameValue
code$("p").unmousedown();
resultamp;gt;Hello</p>
before<p amp;gt;Hello</p>
catEvents/Mouse
230

Object

NameValue
shortBind a function to the mouseover event of each matched element.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descA function to bind to the mousedown event on each of the matched elements.
namefn
descBind a function to the mouseover event of each matched element.
tests(empty Array)
typejQuery
namemouseover
examples

Array

IndexValue
0

Object

NameValue
code$("p").mouseover( function() { alert("Hello"); } );
result<p amp;gt;Hello</p>
beforeamp;gt;Hello</p>
catEvents/Mouse
231

Object

NameValue
shortTrigger the mouseover event of each matched element.
params(empty Array)
descTrigger the mouseover event of each matched element. This causes all of the functions
that have been bound to thet mousedown event to be executed.
tests(empty Array)
typejQuery
namemouseover
examples

Array

IndexValue
0

Object

NameValue
code$("p").mouseover();
resultalert('Hello');
before<p amp;gt;Hello</p>
catEvents/Mouse
232

Object

NameValue
shortBind a function to the mouseover event of each matched element, which will only be executed once.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descA function to bind to the mouseover event on each of the matched elements.
namefn
descBind a function to the mouseover event of each matched element, which will only be executed once.
Unlike a call to the normal .mouseover() method, calling .onemouseover() causes the bound function to be
only executed the first time it is triggered, and never again (unless it is re-bound).
tests(empty Array)
typejQuery
nameonemouseover
examples

Array

IndexValue
0

Object

NameValue
code$("p").onemouseover( function() { alert("Hello"); } );
resultalert('Hello'); // Only executed for the first mouseover
before<p amp;gt;Hello</p>
catEvents/Mouse
233

Object

NameValue
shortRemoves a bound mouseover event from each of the matched
elements.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descA function to unbind from the mouseover event on each of the matched elements.
namefn
descRemoves a bound mouseover event from each of the matched
elements. You must pass the identical function that was used in the original
bind method.
tests(empty Array)
typejQuery
nameunmouseover
examples

Array

IndexValue
0

Object

NameValue
code$("p").unmouseover( myFunction );
resultamp;gt;Hello</p>
before<p amp;gt;Hello</p>
catEvents/Mouse
234

Object

NameValue
shortRemoves all bound mouseover events from each of the matched elements.
params(empty Array)
descRemoves all bound mouseover events from each of the matched elements.
tests(empty Array)
typejQuery
nameunmouseover
examples

Array

IndexValue
0

Object

NameValue
code$("p").unmouseover();
resultamp;gt;Hello</p>
before<p amp;gt;Hello</p>
catEvents/Mouse
235

Object

NameValue
short
params(empty Array)
desc
tests

Array

IndexValue
0var count;
// ignore load
var e = scroll,unload,click,dblclick," +
n,mouseup,mousemove,mouseover,mouseout,chan +

/>var handler1 = function(event) {
count++;
};
var handler2 = function(event) {
count++;
};
for( var i=0; i < e.length; i++) {
var event = e[i];
count = 0;
// bind handler

document)[event](handler2);
nt)["one"+event](handler1);
/>
// call event two times
$(document)[event]();
$(document)[event]();

// unbind events

/> // call once more
$(document)[event]();

// remove all handlers

/>
// call once more
$(document)[event]();

// assert count
ok( count == 6, 'Checking event ' + event);
}
nameeventTesting
private1
examples(empty Array)
catEvents
236

Object

NameValue
shortShow all matched elements using a graceful animation.
params

Array

IndexValue
0

Object

NameValue
typeObject
descA string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000).
namespeed
descShow all matched elements using a graceful animation.
The height, width, and opacity of each of the matched elements
are changed dynamically according to the specified speed.
tests(empty Array)
typejQuery
nameshow
examples

Array

IndexValue
0

Object

NameValue
code$("p").show("slow");
catEffects/Animations
237

Object

NameValue
shortShow all matched elements using a graceful animation and firing a callback
function after completion.
params

Array

IndexValue
0

Object

NameValue
typeObject
descA string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000).
namespeed
1

Object

NameValue
typeFunction
descA function to be executed whenever the animation completes.
namecallback
descShow all matched elements using a graceful animation and firing a callback
function after completion.
The height, width, and opacity of each of the matched elements
are changed dynamically according to the specified speed.
tests(empty Array)
typejQuery
nameshow
examples

Array

IndexValue
0

Object

NameValue
codep").show("slow",function(){
/> alert("Animation Done.");
});
catEffects/Animations
238

Object

NameValue
shortHide all matched elements using a graceful animation.
params

Array

IndexValue
0

Object

NameValue
typeObject
descA string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000).
namespeed
descHide all matched elements using a graceful animation.
The height, width, and opacity of each of the matched elements
are changed dynamically according to the specified speed.
tests(empty Array)
typejQuery
namehide
examples

Array

IndexValue
0

Object

NameValue
code$("p").hide("slow");
catEffects/Animations
239

Object

NameValue
shortHide all matched elements using a graceful animation and firing a callback
function after completion.
params

Array

IndexValue
0

Object

NameValue
typeObject
descA string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000).
namespeed
1

Object

NameValue
typeFunction
descA function to be executed whenever the animation completes.
namecallback
descHide all matched elements using a graceful animation and firing a callback
function after completion.
The height, width, and opacity of each of the matched elements
are changed dynamically according to the specified speed.
tests(empty Array)
typejQuery
namehide
examples

Array

IndexValue
0

Object

NameValue
codep").hide("slow",function(){
/> alert("Animation Done.");
});
catEffects/Animations
240

Object

NameValue
shortReveal all matched elements by adjusting their height.
params

Array

IndexValue
0

Object

NameValue
typeObject
descA string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000).
namespeed
descReveal all matched elements by adjusting their height.
Only the height is adjusted for this animation, causing all matched
elements to be revealed in a "sliding" manner.
tests(empty Array)
typejQuery
nameslideDown
examples

Array

IndexValue
0

Object

NameValue
code$("p").slideDown("slow");
catEffects/Animations
241

Object

NameValue
shortReveal all matched elements by adjusting their height and firing a callback
function after completion.
params

Array

IndexValue
0

Object

NameValue
typeObject
descA string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000).
namespeed
1

Object

NameValue
typeFunction
descA function to be executed whenever the animation completes.
namecallback
descReveal all matched elements by adjusting their height and firing a callback
function after completion.
Only the height is adjusted for this animation, causing all matched
elements to be revealed in a "sliding" manner.
tests(empty Array)
typejQuery
nameslideDown
examples

Array

IndexValue
0

Object

NameValue
codelideDown("slow",function(){
/> alert("Animation Done.");
});
catEffects/Animations
242

Object

NameValue
shortHide all matched elements by adjusting their height.
params

Array

IndexValue
0

Object

NameValue
typeObject
descA string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000).
namespeed
descHide all matched elements by adjusting their height.
Only the height is adjusted for this animation, causing all matched
elements to be hidden in a "sliding" manner.
tests(empty Array)
typejQuery
nameslideUp
examples

Array

IndexValue
0

Object

NameValue
code$("p").slideUp("slow");
catEffects/Animations
243

Object

NameValue
shortHide all matched elements by adjusting their height and firing a callback
function after completion.
params

Array

IndexValue
0

Object

NameValue
typeObject
descA string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000).
namespeed
1

Object

NameValue
typeFunction
descA function to be executed whenever the animation completes.
namecallback
descHide all matched elements by adjusting their height and firing a callback
function after completion.
Only the height is adjusted for this animation, causing all matched
elements to be hidden in a "sliding" manner.
tests(empty Array)
typejQuery
nameslideUp
examples

Array

IndexValue
0

Object

NameValue
code.slideUp("slow",function(){
/> alert("Animation Done.");
});
catEffects/Animations
244

Object

NameValue
shortToggle the visibility of all matched elements by adjusting their height.
params

Array

IndexValue
0

Object

NameValue
typeObject
descA string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000).
namespeed
descToggle the visibility of all matched elements by adjusting their height.
Only the height is adjusted for this animation, causing all matched
elements to be hidden in a "sliding" manner.
tests(empty Array)
typejQuery
nameslideToggle
examples

Array

IndexValue
0

Object

NameValue
code$("p").slideToggle("slow");
catEffects/Animations
245

Object

NameValue
shortToggle the visibility of all matched elements by adjusting their height
and firing a callback function after completion.
params

Array

IndexValue
0

Object

NameValue
typeObject
descA string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000).
namespeed
1

Object

NameValue
typeFunction
descA function to be executed whenever the animation completes.
namecallback
descToggle the visibility of all matched elements by adjusting their height
and firing a callback function after completion.
Only the height is adjusted for this animation, causing all matched
elements to be hidden in a "sliding" manner.
tests(empty Array)
typejQuery
nameslideToggle
examples

Array

IndexValue
0

Object

NameValue
codedeToggle("slow",function(){
/> alert("Animation Done.");
});
catEffects/Animations
246

Object

NameValue
shortFade in all matched elements by adjusting their opacity.
params

Array

IndexValue
0

Object

NameValue
typeObject
descA string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000).
namespeed
descFade in all matched elements by adjusting their opacity.
Only the opacity is adjusted for this animation, meaning that
all of the matched elements should already have some form of height
and width associated with them.
tests(empty Array)
typejQuery
namefadeIn
examples

Array

IndexValue
0

Object

NameValue
code$("p").fadeIn("slow");
catEffects/Animations
247

Object

NameValue
shortFade in all matched elements by adjusting their opacity and firing a
callback function after completion.
params

Array

IndexValue
0

Object

NameValue
typeObject
descA string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000).
namespeed
1

Object

NameValue
typeFunction
descA function to be executed whenever the animation completes.
namecallback
descFade in all matched elements by adjusting their opacity and firing a
callback function after completion.
Only the opacity is adjusted for this animation, meaning that
all of the matched elements should already have some form of height
and width associated with them.
tests(empty Array)
typejQuery
namefadeIn
examples

Array

IndexValue
0

Object

NameValue
code).fadeIn("slow",function(){
/> alert("Animation Done.");
});
catEffects/Animations
248

Object

NameValue
shortFade out all matched elements by adjusting their opacity.
params

Array

IndexValue
0

Object

NameValue
typeObject
descA string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000).
namespeed
descFade out all matched elements by adjusting their opacity.
Only the opacity is adjusted for this animation, meaning that
all of the matched elements should already have some form of height
and width associated with them.
tests(empty Array)
typejQuery
namefadeOut
examples

Array

IndexValue
0

Object

NameValue
code$("p").fadeOut("slow");
catEffects/Animations
249

Object

NameValue
shortFade out all matched elements by adjusting their opacity and firing a
callback function after completion.
params

Array

IndexValue
0

Object

NameValue
typeObject
descA string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000).
namespeed
1

Object

NameValue
typeFunction
descA function to be executed whenever the animation completes.
namecallback
descFade out all matched elements by adjusting their opacity and firing a
callback function after completion.
Only the opacity is adjusted for this animation, meaning that
all of the matched elements should already have some form of height
and width associated with them.
tests(empty Array)
typejQuery
namefadeOut
examples

Array

IndexValue
0

Object

NameValue
code.fadeOut("slow",function(){
/> alert("Animation Done.");
});
catEffects/Animations
250

Object

NameValue
shortFade the opacity of all matched elements to a specified opacity.
params

Array

IndexValue
0

Object

NameValue
typeObject
descA string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000).
namespeed
1

Object

NameValue
typeNumber
descThe opacity to fade to (a number from 0 to 1).
nameopacity
descFade the opacity of all matched elements to a specified opacity.
Only the opacity is adjusted for this animation, meaning that
all of the matched elements should already have some form of height
and width associated with them.
tests(empty Array)
typejQuery
namefadeTo
examples

Array

IndexValue
0

Object

NameValue
code$("p").fadeTo("slow", 0.5);
catEffects/Animations
251

Object

NameValue
shortFade the opacity of all matched elements to a specified opacity and
firing a callback function after completion.
params

Array

IndexValue
0

Object

NameValue
typeObject
descA string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000).
namespeed
1

Object

NameValue
typeNumber
descThe opacity to fade to (a number from 0 to 1).
nameopacity
2

Object

NameValue
typeFunction
descA function to be executed whenever the animation completes.
namecallback
descFade the opacity of all matched elements to a specified opacity and
firing a callback function after completion.
Only the opacity is adjusted for this animation, meaning that
all of the matched elements should already have some form of height
and width associated with them.
tests(empty Array)
typejQuery
namefadeTo
examples

Array

IndexValue
0

Object

NameValue
code$("p").fadeTo("slow", 0.5, function(){
alert("Animation Done.");
});
catEffects/Animations
252

Object

NameValue
shortA function for making your own, custom, animations.
params

Array

IndexValue
0

Object

NameValue
typeHash
descA set of style attributes that you wish to animate, and to what end.
nameparams
1

Object

NameValue
typeObject
descA string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000).
namespeed
2

Object

NameValue
typeFunction
descA function to be executed whenever the animation completes.
namecallback
descA function for making your own, custom, animations. The key aspect of
this function is the object of style properties that will be animated,
and to what end. Each key within the object represents a style property
that will also be animated (for example: "height", "top", or "opacity").

The value associated with the key represents to what end the property
will be animated. If a number is provided as the value, then the style
property will be transitioned from its current state to that new number.
Oterwise if the string "hide", "show", or "toggle" is provided, a default
animation will be constructed for that property.
tests(empty Array)
typejQuery
nameanimate
examples

Array

IndexValue
0

Object

NameValue
code$("p").animate({
height: 'toggle', opacity: 'toggle'
}, "slow");
1

Object

NameValue
code$("p").animate({
left: 50, opacity: 'show'
}, 500);
catEffects/Animations
253

Object

NameValue
shortLoad HTML from a remote file and inject it into the DOM, only if it's
been modified by the server.
params

Array

IndexValue
0

Object

NameValue
typeString
descThe URL of the HTML file to load.
nameurl
1

Object

NameValue
typeHash
descA set of key/value pairs that will be sent to the server.
nameparams
2

Object

NameValue
typeFunction
descA function to be executed whenever the data is loaded.
namecallback
descLoad HTML from a remote file and inject it into the DOM, only if it's
been modified by the server.
tests(empty Array)
typejQuery
nameloadIfModified
examples

Array

IndexValue
0

Object

NameValue
code).loadIfModified("feeds.html")
result<div ;b>45</b> feeds found.</div>
before<div s"></div>
catAJAX
254

Object

NameValue
shortLoad HTML from a remote file and inject it into the DOM.
params

Array

IndexValue
0

Object

NameValue
typeString
descThe URL of the HTML file to load.
nameurl
1

Object

NameValue
typeHash
descA set of key/value pairs that will be sent to the server.
nameparams
2

Object

NameValue
typeFunction
descA function to be executed whenever the data is loaded.
namecallback
descLoad HTML from a remote file and inject it into the DOM.
tests

Array

IndexValue
0stop();
function() {
ok( $('#first').text() == 'ERROR', 'Check if content was injected into the DOM' );
start();
});
1stop(); // check if load can be called with only url

/>$.get("data/name.php", function() {
ok( $('#first').text() == 'ERROR', 'Check if load works without callback');
start();
});
typejQuery
nameload
examples

Array

IndexValue
0

Object

NameValue
code$("#feeds").load("feeds.html")
result<div ;b>45</b> feeds found.</div>
before<div s"></div>
1

Object

NameValue
descSame as above, but with an additional parameter
and a callback that is executed when the data was loaded.
code#feeds").load("feeds.html",
/> {test: true},
function() { alert("load is done"); }
);
catAJAX
255

Object

NameValue
shortSerializes a set of input elements into a string of data.
params(empty Array)
descSerializes a set of input elements into a string of data.
This will serialize all given elements. If you need
serialization similar to the form submit of a browser,
you should use the form plugin. This is also true for
selects with multiple attribute set, only a single option
is serialized.
tests

Array

IndexValue
0var data = .not('button').serialize();
/>// ignore button, IE takes text content as value, not relevant for this test
ok( data == ;select2=3&select3=1',oobar&select1=&select2=3&select3=1',=&name=name&=foobar&select1=&select2=3&select3=1',p;amp;hidden=&foo[bar]=&name=name&=foobar&select1=&select2=3&select3=1',mp;amp;check=on&=on&hidden=&foo[bar]=&name=name&=foobar&;radio1=on&radio2=on&check=on&=on&hidest&text2=Test&radio1=o 'Check form serialization as query string' );
typeString
nameserialize
examples

Array

IndexValue
0

Object

NameValue
aftere=John&location=Boston
descSerialize a selection of input elements to a string
before<input type='text' name='name' value='John'/>
<input type='text' name='location' value='Boston'/>
codeput[@type=text]").serialize();
catAJAX
256

Object

NameValue
shortAttach a function to be executed whenever an AJAX request begins.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descThe function to execute.
namecallback
descAttach a function to be executed whenever an AJAX request begins.
tests(empty Array)
typejQuery
nameajaxStart
examples

Array

IndexValue
0

Object

NameValue
descShow a loading message whenever an AJAX request starts.
codeing").ajaxStart(function(){
/> $(this).show();
});
catAJAX
257

Object

NameValue
shortAttach a function to be executed whenever all AJAX requests have ended.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descThe function to execute.
namecallback
descAttach a function to be executed whenever all AJAX requests have ended.
tests(empty Array)
typejQuery
nameajaxStop
examples

Array

IndexValue
0

Object

NameValue
descHide a loading message after all the AJAX requests have stopped.
codeding").ajaxStop(function(){
/> $(this).hide();
});
catAJAX
258

Object

NameValue
shortAttach a function to be executed whenever an AJAX request completes.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descThe function to execute.
namecallback
descAttach a function to be executed whenever an AJAX request completes.
tests(empty Array)
typejQuery
nameajaxComplete
examples

Array

IndexValue
0

Object

NameValue
descShow a message when an AJAX request completes.
code").ajaxComplete(function(){
/> end("<li>Request lete.</li>");
/>});
catAJAX
259

Object

NameValue
shortAttach a function to be executed whenever an AJAX request completes
successfully.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descThe function to execute.
namecallback
descAttach a function to be executed whenever an AJAX request completes
successfully.
tests(empty Array)
typejQuery
nameajaxSuccess
examples

Array

IndexValue
0

Object

NameValue
descShow a message when an AJAX request completes successfully.
codeg").ajaxSuccess(function(){
/> ("<li>Successful uest!</li>");
/>});
catAJAX
260

Object

NameValue
shortAttach a function to be executed whenever an AJAX request fails.
params

Array

IndexValue
0

Object

NameValue
typeFunction
descThe function to execute.
namecallback
descAttach a function to be executed whenever an AJAX request fails.
tests(empty Array)
typejQuery
nameajaxError
examples

Array

IndexValue
0

Object

NameValue
descShow a message when an AJAX request fails.
codemsg").ajaxError(function(){
/> ppend("<li>Error requesting page.</li>");
});
catAJAX
261

Object

NameValue
params(empty Array)
desc
tests

Array

IndexValue
0stop(); var counter = { complete: 0, success: 0, error: 0 };
var success = function() { counter.success++ };
var error = function() { counter.error++ };
var complete = function() { counter.complete++ };

Complete(complete).ajaxError(error).ajaxSuccess(success);
plete).ajaxStop(complete).ajaxComplete(complete).ajaxEr />// start with successful test
$.ajax({url: "data/name.php", success: success, error: error, complete: function() {
ok( counter.error == 0, 'Check succesful request' );
ok( counter.success == 2, 'Check succesful request' );
ok( counter.complete == 3, 'Check succesful request' );
counter.error = 0; counter.success = 0; counter.complete = 0;
$.ajaxTimeout(500);
$.ajax({url: "data/name.php?wait=5", success: success, error: error, complete: function() {
ok( counter.error == 2, 'Check failed request' );
ok( counter.success == 0, 'Check failed request' );
ok( counter.complete == 3, 'Check failed request' );
start();
}});
}});
1stop(); var counter = { complete: 0, success: 0, error: 0 };
counter.error = 0; counter.success = 0; counter.complete = 0;
var success = function() { counter.success++ };
var error = function() { counter.error++ };
$.ajaxTimeout(0);
$.ajax({url: "data/name.php", global: false, success: success, error: error, complete: function() {
ok( counter.error == 0, 'Check sucesful request without globals' );
ok( counter.success == 1, 'Check sucesful request without globals' );
ok( counter.complete == 0, 'Check sucesful request without globals' );
counter.error = 0; counter.success = 0; counter.complete = 0;
$.ajaxTimeout(500);
$.ajax({url: "data/name.php?wait=5", global: false, success: success, error: error, complete: function() {
ok( counter.error == 1, 'Check failed request without globals' );
ok( counter.success == 0, 'Check failed request without globals' );
ok( counter.complete == 0, 'Check failed request without globals' );
start();
}});
}});
nameajaxHandlersTesting
private1
examples(empty Array)
short
262

Object

NameValue
shortLoad a remote page using an HTTP GET request.
params

Array

IndexValue
0

Object

NameValue
typeString
descThe URL of the page to load.
nameurl
1

Object

NameValue
typeHash
descA set of key/value pairs that will be sent to the server.
nameparams
2

Object

NameValue
typeFunction
descA function to be executed whenever the data is loaded.
namecallback
descLoad a remote page using an HTTP GET request. All of the arguments to
the method (except URL) are optional.
tests(empty Array)
typejQuery
name$.get
examples

Array

IndexValue
0

Object

NameValue
code$.get("test.cgi")
1

Object

NameValue
code$.get("test.cgi", { name: "John", time: "2pm" } )
2

Object

NameValue
code$.get("test.cgi", function(data){
alert("Data Loaded: " + data);
})
3

Object

NameValue
code$.get("test.cgi",
{ name: "John", time: "2pm" },
function(data){
alert("Data Loaded: " + data);
}
)
catAJAX
263

Object

NameValue
shortLoad a remote page using an HTTP GET request, only if it hasn't
been modified since it was last retrieved.
params

Array

IndexValue
0

Object

NameValue
typeString
descThe URL of the page to load.
nameurl
1

Object

NameValue
typeHash
descA set of key/value pairs that will be sent to the server.
nameparams
2

Object

NameValue
typeFunction
descA function to be executed whenever the data is loaded.
namecallback
descLoad a remote page using an HTTP GET request, only if it hasn't
been modified since it was last retrieved. All of the arguments to
the method (except URL) are optional.
tests

Array

IndexValue
0stop();
function(msg) {
ok( msg == 'ERROR', 'Check ifModified' );
start();
});
typejQuery
name$.getIfModified
examples

Array

IndexValue
0

Object

NameValue
code$.getIfModified("test.html")
1

Object

NameValue
code$.getIfModified("test.html", { name: "John", time: "2pm" } )
2

Object

NameValue
code$.getIfModified("test.cgi", function(data){
alert("Data Loaded: " + data);
})
3

Object

NameValue
code$.getifModified("test.cgi",
{ name: "John", time: "2pm" },
function(data){
alert("Data Loaded: " + data);
}
)
catAJAX
264

Object

NameValue
shortLoads, and executes, a remote JavaScript file using an HTTP GET request.
params

Array

IndexValue
0

Object

NameValue
typeString
descThe URL of the page to load.
nameurl
1

Object

NameValue
typeFunction
descA function to be executed whenever the data is loaded.
namecallback
descLoads, and executes, a remote JavaScript file using an HTTP GET request.
All of the arguments to the method (except URL) are optional.
tests

Array

IndexValue
0stop();
$.getScript("data/test.js", function() {
ok( foobar == "bar", 'Check if script was evaluated' );
start();
});
typejQuery
name$.getScript
examples

Array

IndexValue
0

Object

NameValue
code$.getScript("test.js")
1

Object

NameValue
code$.getScript("test.js", function(){
alert("Script loaded and executed.");
})
catAJAX
265

Object

NameValue
shortLoad a remote JSON object using an HTTP GET request.
params

Array

IndexValue
0

Object

NameValue
typeString
descThe URL of the page to load.
nameurl
1

Object

NameValue
typeHash
descA set of key/value pairs that will be sent to the server.
nameparams
2

Object

NameValue
typeFunction
descA function to be executed whenever the data is loaded.
namecallback
descLoad a remote JSON object using an HTTP GET request.
All of the arguments to the method (except URL) are optional.
tests

Array

IndexValue
0stop();
$.getJSON("data/json.php", {json: "array"}, function(json) {
ok( json[0].name == 'John', 'Check JSON: first, name' );
ok( json[0].age == 21, 'Check JSON: first, age' );
ok( json[1].name == 'Peter', 'Check JSON: second, name' );
ok( json[1].age == 25, 'Check JSON: second, age' );
start();
});
1stop();
$.getJSON("data/json.php", function(json) {
ok( json.data.lang == 'en', 'Check JSON: lang' );
ok( json.data.length == 25, 'Check JSON: length' );
start();
});
typejQuery
name$.getJSON
examples

Array

IndexValue
0

Object

NameValue
code$.getJSON("test.js", function(json){
alert("JSON Data: " + json.users[3].name);
})
1

Object

NameValue
code$.getJSON("test.js",
{ name: "John", time: "2pm" },
function(json){
alert("JSON Data: " + json.users[3].name);
}
)
catAJAX
266

Object

NameValue
shortLoad a remote page using an HTTP POST request.
params

Array

IndexValue
0

Object

NameValue
typeString
descThe URL of the page to load.
nameurl
1

Object

NameValue
typeHash
descA set of key/value pairs that will be sent to the server.
nameparams
2

Object

NameValue
typeFunction
descA function to be executed whenever the data is loaded.
namecallback
descLoad a remote page using an HTTP POST request. All of the arguments to
the method (except URL) are optional.
tests

Array

IndexValue
0stop();
$.post("data/name.php", {xml: "5-2"}, function(xml){
$('math', xml).each(function() {
ok( $('calculation', this).text() == '5-2', 'Check for XML' );
ok( $('result', this).text() == '3', 'Check for XML' );
});
start();
});
typejQuery
name$.post
examples

Array

IndexValue
0

Object

NameValue
code$.post("test.cgi")
1

Object

NameValue
code$.post("test.cgi", { name: "John", time: "2pm" } )
2

Object

NameValue
code$.post("test.cgi", function(data){
alert("Data Loaded: " + data);
})
3

Object

NameValue
code$.post("test.cgi",
{ name: "John", time: "2pm" },
function(data){
alert("Data Loaded: " + data);
}
)
catAJAX
267

Object

NameValue
shortSet the timeout of all AJAX requests to a specific amount of time.
params

Array

IndexValue
0

Object

NameValue
typeNumber
descHow long before an AJAX request times out.
nametime
descSet the timeout of all AJAX requests to a specific amount of time.
This will make all future AJAX requests timeout after a specified amount
of time (the default is no timeout).
tests

Array

IndexValue
0stop();
var passed = 0;
var timeout;
$.ajaxTimeout(1000);
var pass = function() {
passed++;
if(passed == 2) {
ok( true, 'Check local and global callbacks after timeout' );
clearTimeout(timeout);
main').unbind("ajaxError");
/> start();
}
};
var fail = function() {
ok( false, 'Check for timeout failed' );
start();
};
timeout = setTimeout(fail, 1500);

/>$.ajax({
type: "GET",
url: "data/name.php?wait=5",
error: pass,
success: fail
});
1stop(); $.ajaxTimeout(50);
$.ajax({
type: "GET",
timeout: 5000,
url: "data/name.php?wait=1",
error: function() {
ok( false, 'Check for local timeout failed' );
start();
},
success: function() {
ok( true, 'Check for local timeout' );
start();
}
});
// reset timeout
$.ajaxTimeout(0);
typejQuery
name$.ajaxTimeout
examples

Array

IndexValue
0

Object

NameValue
descMake all AJAX requests timeout after 5 seconds.
code$.ajaxTimeout( 5000 );
catAJAX
268

Object

NameValue
shortLoad a remote page using an HTTP request.
params

Array

IndexValue
0

Object

NameValue
typeHash
descA set of properties to initialize the request with.
nameprop
descLoad a remote page using an HTTP request. This function is the primary
means of making AJAX requests using jQuery. $.ajax() takes one property,
an object of key/value pairs, that're are used to initalize the request.

These are all the key/values that can be passed in to 'prop':

(String) type - The type of request to make (e.g. "POST" or "GET").

(String) url - The URL of the page to request.

(String) data - A string of data to be sent to the server (POST only).

(String) dataType - The type of data that you're expecting back from
the server (e.g. "xml", "html", "script", or "json").

(Boolean) ifModified - Allow the request to be successful only if the
response has changed since the last request, default is false, ignoring
the Last-Modified header

(Number) timeout - Local timeout to override global timeout, eg. to give a
single request a longer timeout while all others timeout after 1 seconds,
see $.ajaxTimeout

(Boolean) global - Wheather to trigger global AJAX event handlers for
this request, default is true. Set to true to prevent that global handlers
like ajaxStart or ajaxStop are triggered.

(Function) error - A function to be called if the request fails. The
function gets passed two arguments: The XMLHttpRequest object and a
string describing the type of error that occurred.

(Function) success - A function to be called if the request succeeds. The
function gets passed one argument: The data returned from the server,
formatted according to the 'dataType' parameter.

(Function) complete - A function to be called when the request finishes. The
function gets passed two arguments: The XMLHttpRequest object and a
string describing the type the success of the request.
tests

Array

IndexValue
0stop();
$.ajax({
type: "GET",
url: "data/name.php?name=foo",
success: function(msg){
ok( msg == 'bar', 'Check for GET' );
start();
}
});
1stop();
$.ajax({
type: "POST",
url: "data/name.php",
data: "name=peter",
success: function(msg){
ok( msg == 'pan', 'Check for POST' );
start();
}
});
typejQuery
name$.ajax
examples

Array

IndexValue
0

Object

NameValue
descLoad and execute a JavaScript file.
code$.ajax({
type: "GET",
url: "test.js",
dataType: "script"
})
1

Object

NameValue
descSave some data to the server and notify the user once its complete.
code$.ajax({
type: "POST",
url: "some.php",
data: n&location=Boston",
/> success: function(msg){
alert( "Data Saved: " + msg );
}
});
catAJAX