You are on page 1of 2

jQuery 1.

3 Cheat Sheet
Core Selectors
jQuery Function Basic Attribute Filters
FUNCTION RETURNS SELECTOR RETURNS SELECTOR RETURNS
2
$(expr, [context]) jQuery * Array<Element> [attr] Array<Element>
2
$(html, [owner]) jQuery #id Array<Element> [attr=value] Array<Element>
2
$(elems) jQuery name Array<Element> [attr!=value] Array<Element>
2
$(func) jQuery .class Array<Element> [attr^=value] Array<Element>
2
selector1, selectorN Array<Element> [attr$=value] Array<Element>
jQuery Object Accessors
2
PROPERTY RETURNS [attr*=value] Array<Element>
selector 1
String Hierarchy
2
SELECTOR RETURNS [attr1][attr2][attrN] Array<Element>
1
context Element ancestor descendant Array<Element> 2) The [@attr] style selectors were removed in jQuery 1.3

length Number parent > child Array<Element> Child Filters


FUNCTION RETURNS SELECTOR RETURNS
previous + next Array<Element>
size() Number :nth-child(index | even | odd | Array<Element>
previous ~ siblings Array<Element> equation)
eq(index) jQuery
:first-child Array<Element>
get() Array<Element> Basic Filters
SELECTOR RETURNS :last-child Array<Element>
get(index) Element :first Array<Element>
:only-child Array<Element>
index(element) Number :last Array<Element>
each(func) jQuery :not(selector) Array<Element> Forms
SELECTOR RETURNS
1) New in jQuery 1.3
:even Array<Element> :hidden Array<Element>
Data
FUNCTION RETURNS :odd Array<Element> :input Array<Element>
data(name) Object :eq(index) Array<Element> :text Array<Element>
data(name, value) jQuery :gt(index) Array<Element> :password Array<Element>
removeData(name) jQuery :lt(index) Array<Element> :checkbox Array<Element>
queue(name) Array<Function> :header Array<Element> :radio Array<Element>
queue(name, func) jQuery :animated Array<Element> :image Array<Element>
queue(name, queue) jQuery :file Array<Element>
Content Filters
dequeue(name) jQuery SELECTOR RETURNS :button Array<Element>
:contains(text) Array<Element>
Plugins :submit Array<Element>
FUNCTION RETURNS :empty Array<Element>
:reset Array<Element>
$.fn.extend(object) jQuery :has(selector) Array<Element>
$.extend(object) jQuery :parent Array<Element> Form Filters
SELECTOR RETURNS

Interoperability :enabled Array<Element>


FUNCTION RETURNS
Visibility Filters
SELECTOR RETURNS :disabled Array<Element>
$.noConflict() jQuery :hidden Array<Element>
:checked Array<Element>
$.noConflict(extreme) jQuery :visible Array<Element>
:selected Array<Element>

Attributes Manipulation Traversing


Attr Insert Inside Filtering
FUNCTION RETURNS FUNCTION RETURNS FUNCTION RETURNS

attr(name) Object append(content) jQuery filter(expr) jQuery


attr(props) jQuery appendTo(selector) jQuery filter(func) jQuery
attr(key, value | func) jQuery prepend(content) jQuery is(expr) Boolean
removeAttr(name) jQuery prependTo(selector) jQuery map(func) jQuery
not(expr) jQuery
Class Insert Outside
FUNCTION RETURNS FUNCTION RETURNS slice(start, [end]) jQuery
hasClass(class) Boolean after(content) jQuery
addClass(class) jQuery before(content) jQuery Finding
FUNCTION RETURNS

removeClass([class]) jQuery insertAfter(content) jQuery add(expr) jQuery


toggleClass(class) jQuery insertBefore(content) jQuery children([expr]) jQuery
toggleClass(class, switch) jQuery closest([expr]) jQuery
Insert Around
FUNCTION RETURNS contents() jQuery
HTML wrap(html | element) jQuery
FUNCTION RETURNS find(expr) jQuery
html() String wrapAll(html | element) jQuery
next([expr]) jQuery
html(value) jQuery wrapInner(html | elem) jQuery
nextAll([expr]) jQuery
Text Replace prev([expr]) jQuery
FUNCTION RETURNS FUNCTION RETURNS

text() String replaceWith(content) jQuery prevAll([expr]) jQuery

text(value) jQuery replaceAll(selector) jQuery offsetParent() jQuery


parent([expr]) jQuery
Value Remove
FUNCTION RETURNS FUNCTION RETURNS parents([expr]) jQuery
val() String, Array empty() jQuery siblings([expr]) jQuery
val(value) jQuery remove([expr]) jQuery
Chaining
FUNCTION RETURNS
Copy
FUNCTION RETURNS andSelf() jQuery
clone([events]) jQuery end() jQuery

Legend
SYNTAX DESCRIPTION SYNTAX DESCRIPTION SYNTAX DESCRIPTION SYNTAX DESCRIPTION

function functions or properties argument arguments | one argument only [] optional argument
jQuery 1.3 Cheat Sheet
Events CSS Utilities
Page Load CSS Browser & Feature Detection
FUNCTION RETURNS FUNCTION RETURNS PROPERTY RETURNS
5
ready(func) jQuery css(name) String $.browser Map
5
css(props) jQuery $.browser.version String
Event Handling
5
FUNCTION RETURNS css(name, value) jQuery $.boxModel Boolean
bind(type, [data], func) jQuery 6
$.support.boxModel Boolean
one(type, [data], func) jQuery Position
6
FUNCTION RETURNS $.support.cssFloat Boolean
trigger(event, [data]) jQuery offset() Object {top, left} 6
$.support.hrefNormalized Boolean
triggerHandler(event, [data]) Object position() Object {top, left} 6
$.support.htmlSerialize Boolean
unbind([type], [data]) jQuery scrollTop() Integer 6
$.support.leadingWhitespace Boolean
scrollTop(value) jQuery
Live Events $.support.noCloneEvent 6
Boolean
FUNCTION RETURNS scrollLeft() Integer 6
live(type, func) 3
jQuery $.support.objectAll Boolean
scrollLeft(value) jQuery 6
die([type], [func]) 3
jQuery $.support.opacity Boolean
Dimension $.support.scriptEval 6
Boolean
Interaction Helpers FUNCTION RETURNS
6
FUNCTION RETURNS width() Integer $.support.style Boolean
hover(over, out) jQuery $.support.tbody 6
Boolean
width(value) jQuery
toggle(func1, func2, ..., [funcN]) jQuery 5) Deprecated in jQuery 1.3
height() Integer 6) New in jQuery 1.3

Event Helpers height(value) jQuery Array & Object Operations


FUNCTION RETURNS FUNCTION RETURNS

blur([func]) 4
jQuery innerWidth() Integer $.each(object, func) Object
change([func]) 4
jQuery innerHeight() Integer $.extend([deep], target, object1, Object
4 outerWidth([options]) Integer ..., [objectN])
click([func]) jQuery
4 outerHeight([options]) Integer $.grep(array, func, [invert]) Array
dblclick([func]) jQuery
4 $.makeArray(object) Array
error([func]) jQuery
4 Effects $.map(array, func) Array
focus([func]) jQuery
4
Basic $.inArray(value, array) Number
keydown([func]) jQuery FUNCTION RETURNS

4 show() jQuery $.merge(first, second) Array


keypress([func]) jQuery
4 show(speed, [func]) jQuery $.unique(array) Array
keyup([func]) jQuery
load(func) jQuery hide() jQuery Test Operations
FUNCTION RETURNS
mousedown(func) jQuery hide(speed, [func]) jQuery
$.isArray(object) Boolean
mousemove(func) jQuery toggle() jQuery
$.isFunction(object) Boolean
mouseout(func) jQuery toggle(switch) jQuery
toggle(speed, [func]) jQuery String Operations
mouseover(func) jQuery FUNCTION RETURNS

mouseup(func) jQuery $.trim(string) String


Sliding
FUNCTION RETURNS
resize(func) jQuery URLs
slideDown(speed, [func]) jQuery FUNCTION RETURNS
scroll(func) jQuery
slideUp(speed, [func]) jQuery $.param(object) String
4
select([func]) jQuery
slideToggle(speed, [func]) jQuery
4
submit([func]) jQuery Ajax
unload(func) jQuery Fading
FUNCTION RETURNS Requests
3) New in jQuery 1.3 FUNCTION RETURNS
4) Omitting the value triggers the events on each matched element fadeIn(speed, [func]) jQuery
$.ajax(options) XMLHttpRequest
Event Object fadeOut(speed, [func]) jQuery
PROPERTY RETURNS
load(url, [data], [func]) jQuery
fadeTo(speed, opacity, [func]) jQuery
type String $.get(url, [data], [func], [type]) XMLHttpRequest
target Element Custom $.post(url, [data], [func], [type]) XMLHttpRequest
FUNCTION RETURNS
relatedTarget Element animate(params, [duration], $.getJSON(url, [data], [func]) XMLHttpRequest
jQuery
currentTarget Element [easing], [func]) $.getScript(url, [func]) XMLHttpRequest
pageX String animate(params, options) jQuery
Events
pageY String stop([clearQueue], [gotoEnd]) jQuery FUNCTION RETURNS

ajaxComplete([func]) jQuery
result Object Settings
PROPERTY RETURNS ajaxSuccess([func]) jQuery
timeStamp Number
FUNCTION RETURNS
$.fx.off Boolean ajaxError([func]) jQuery
preventDefault() Undefined ajaxSend([func]) jQuery
isDefaultPrevented() Boolean ajaxStart([func]) jQuery
stopPropagation() Undefined ajaxStop([func]) jQuery
isPropagationStopped() Boolean
Miscellaneous
stopImmediatePropagation() Undefined FUNCTION RETURNS

isImmediatePropagationStopped() Boolean $.ajaxSetup(options) jQuery


serialize() String
serializeArray() Array<Object>

Legend
SYNTAX DESCRIPTION SYNTAX DESCRIPTION SYNTAX DESCRIPTION SYNTAX DESCRIPTION

function functions or properties argument arguments | one argument only [] optional argument