Beginner’s essential

jQuery Cheat Sheet

Write less, and do more!
An essential tool for rapid web development.

#################TABLE OF CONTENTSSelectors

3

Attributes / CSS

5

Manipulation

6

Traversing

7

Events8Effects

10

AJAX

11

Core

12

2 of 13

SELECTORS
Basics:target*.class

Content Filters:contains()

element:empty#id:has()selector1, selectorN, …
:parent

Heirarchy
parent > child

Visibility Filters:hiddenancestor descendant:visibleprev + next
prev ~ siblings

Attribute[name|="value"]

Basic Filters[name*="value"]:animated[name~="value"]:eq()[name$="value"]:even[name="value"]:first[name!="value"]:gt()[name^="value"]:header[name]:lang()[name="value"][name2="value2"]:last:lt()

Child Filters:not():first-child:odd:first-of-type:root
3 of 13

:last-childForms:last-of-type:button:nth-child():checkbox:nth-last-child():checked:nth-last-of-type():disabled:nth-of-type():enabled:only-child:focus:only-of-type():filelength:image%:inputborder-box | padding-box |content-box | no-clip:password:radio:reset:selected:submit:text

4 of 13

ATTRIBUTES / CSS.offset().offsetParent()

Attributes.attr().prop().position().scrollLeft().scrollTop().removeAttr().removeProp()Data.val()

jQuery.data().data()

CSS.addClass().css()

jQuery.hasData()
jQuery.removeData().removeData()

jQuery.cssHooks
jQuery.cssNumber
jQuery.escapeSelector().hasClass().removeClass().toggleClass()

Dimensions.height().innerHeight().innerWidth().outerHeight().outerWidth().width()Offset5 of 13MANIPULATION.unwrap()

Copying

DOM Replacement.clone().replaceAll().replaceWith()

DOM Insertion, Around.wrap().wrapAll().wrapInner()

DOM Insertion, Inside.append().appendTo().html().prepend().prependTo().text()DOM Insertion, Outside.after().before().insertAfter().insertBefore()

DOM Removal.detach().empty().remove()
6 of 13TRAVERSING.nextUntil().parent()

Filtering.eq().filter().first().has().is().parents().parentsUntil().prev().prevAll().prevUntil().siblings().last().map().not().slice()Miscellaneous Traversing.add().addBack().andSelf().contents().each().end()

Tree Traversal.children().closest().find().next().nextAll()
7 of 13EVENTS.focus().focusin()

Browser Events.error().resize().focusout().select().submit().scroll()

Keyboard Events
Document Loading.load().ready().keydown().keypress().keyup().unload()

Mouse Events
Event Handler Attachment.bind().delegate().die().live().off().on().one().trigger().triggerHandler().unbind().undelegate()

Form Events.blur().change().click().contextMenu().dblclick().hover().mousedown().mouseenter().mouseleave().mousemove().mouseout().mouseover().mouseup().toggle()Event Object
event.currentTarget
event.delegateTarget
8 of 13event.data
event.isDefaultPrevented()
event.isImmediatePropagationStopped()
event.isPropagationStopped()
event.metaKey
event.namespace
event.pageX
event.pageY
event.preventDefault()
event.relatedTarget
event.result
event.stopImmediatePropagation()
event.stopPropagation()
event.target
event.timeStamp
event.type
event.which

9 of 13EFFECTS

Sliding.slideDown()

Basics.hide().slideToggle().slideUp().show().toggle()Custom.animate().clearQueue().delay().dequeue()jQuery.dequeue().finish()jQuery.fx.interval
jQuery.fx.off
jQuery.speed.queue()jQuery.queue().stop()

Fading.fadeIn().fadeOut().fadeTo().fadeToggle()

10 of 13

AJAX
Global Ajax Event Handlers.ajaxComplete().ajaxError().ajaxSend().ajaxStart().ajaxStop().ajaxSuccess()

Helper Functions
jQuery.param().serialize().serializeArray()

Low-Level Interface
jQuery.ajax()
jQuery.prefilter()
jQuery.ajaxSetup()
jQuery.ajaxTransport()

Shorthand Methods
jQuery.get()jQuery.getJSON()
jQuery.getScript()
jQuery.post().load()

11 of 13

CORE.promise()jQuery Object

Utilities

jQuery()jQuery.boxModeljQuery.noConflict()

jQuery.browser

jQuery.sub()jQuery.contains()

jQuery.holdReady()

jQuery.each()

jQuery.when()jQuery.extend()
jQuery.globalEval()

Deferred Object
jQuery.Deferred()deferred.always()deferred.done()deferred.fail()deferred.isRejected()deferred.isResolved()
deferred.notify()deferred.notifyWith()deferred.pipe()deferred.progress()deferred.promise()deferred.reject()deferred.rejectWith()deferred.resolve()
deferred.resolveWith()deferred.state()
deferred.then()jQuery.grep()
jQuery.inArray()jQuery.isArray()jQuery.isEmptyObject()
jQuery.isFunction()jQuery.isNumeric()jQuery.isPlainObject()
jQuery.isWindow()
jQuery.isXMLDoc()
jQuery.makeArray()jQuery.map()
jQuery.merge()
jQuery.noop()
jQuery.now()
jQuery.parseHTML()
jQuery.parseJSON()
jQuery.parseXML()jQuery.proxy()
12 of 13

jQuery.support

callbacks.fireWith()

jQuery.trim()

callbacks.has()

jQuery.type()

callbacks.lock()jQuery.unique()callbacks.locked()

jQuery.uniqueSort()

callbacks.remove()

DOM Element Methods.get().index().size().toArray()Internals.jquery.context
jQuery.error().length.pushStack().selector

Callbacks Object
jQuery.Callbacks()
callbacks.add()
callbacks.disable()
callbacks.disabled()
callbacks.empty()
callbacks.fire()callbacks.fired()
13 of 13