0% found this document useful (0 votes)
72 views

Jquery Cheat Sheet

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
72 views

Jquery Cheat Sheet

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

13/12/2023, 11:08 jQuery Cheat Sheet

jQuery Quick API Reference

SELECTORS

Basics Visibility Filters Forms


* :hidden :button
.class :visible :checkbox
element :checked
#id Attribute :disabled
selector1, selectorN, ... [name|="value"] :enabled
[name*="value"] :focus
Hierarchy [name~="value"] :file
parent > child [name$="value"] :image
ancestor descendant [name="value"] :input
prev + next [name!="value"] :password
prev ~ siblings [name^="value"] :radio
[name] :reset
Basic Filters [name="value"][name2="value2"] :selected
:submit
:animated
Child Filters :text
:eq()
:even :first-child
:first :first-of-type
:gt() :last-child
:header :last-of-type
:lang() :nth-child()
:last :nth-last-child()
:lt() :nth-last-of-type()
:not() :nth-of-type()
:odd :only-child
:root :only-of-type()
:target

Content Filters
:contains()
:empty
:has()
:parent

https://oscarotero.com/jquery/ 1/5
13/12/2023, 11:08 jQuery Cheat Sheet

ATTRIBUTES / CSS MANIPULATION

Attributes Dimensions Copying


.attr() .height() .clone()
.prop() .innerHeight()
.removeAttr() .innerWidth() DOM Insertion, Around
.removeProp() .outerHeight() .wrap()
.val() .outerWidth() .wrapAll()
.width() .wrapInner()
CSS
.addClass() Offset DOM Insertion, Inside
.css() .offset() .append()
jQuery.cssHooks .offsetParent() .appendTo()
jQuery.cssNumber .position() .html()
jQuery.escapeSelector() .scrollLeft() .prepend()
.hasClass() .scrollTop() .prependTo()
.removeClass() .text()
.toggleClass() Data
jQuery.data() DOM Insertion, Outside
.data() .after()
jQuery.hasData() .before()
jQuery.removeData() .insertAfter()
.removeData() .insertBefore()

DOM Removal
.detach()
.empty()
.remove()
.unwrap()

DOM Replacement
.replaceAll()
.replaceWith()

https://oscarotero.com/jquery/ 2/5
13/12/2023, 11:08 jQuery Cheat Sheet

TRAVERSING

Filtering
.eq()
.even()
.filter()
.first()
.has()
.is()
.last()
.map()
.not()
.odd()
.slice()

Miscellaneous Traversing
.add()
.addBack()
.andSelf()
.contents()
.each()
.end()

Tree Traversal
.children()
.closest()
.find()
.next()
.nextAll()
.nextUntil()
.parent()
.parents()
.parentsUntil()
.prev()
.prevAll()
.prevUntil()
.siblings()

https://oscarotero.com/jquery/ 3/5
13/12/2023, 11:08 jQuery Cheat Sheet

EVENTS EFFECTS

Browser Events Mouse Events Basics


.error() .click() .hide()
.resize() .contextMenu() .show()
.scroll() .dblclick() .toggle()
.hover()
Document Loading .mousedown() Custom
.load() .mouseenter() .animate()
.ready() .mouseleave() .clearQueue()
.unload() .mousemove() .delay()
.mouseout() .dequeue()
Event Handler Attachment .mouseover() jQuery.dequeue()
.mouseup() .finish()
.bind()
.toggle() jQuery.fx.interval
.delegate()
.die() jQuery.fx.off
.live() Event Object jQuery.speed
.off() event.currentTarget .queue()
.on() event.delegateTarget jQuery.queue()
.one() event.data .stop()
.trigger() event.isDefaultPrevented()
.triggerHandler() event.isImmediatePropagationStopped() Fading
.unbind() event.isPropagationStopped() .fadeIn()
.undelegate() event.metaKey .fadeOut()
event.namespace .fadeTo()
Form Events event.pageX .fadeToggle()
event.pageY
.blur()
event.preventDefault() Sliding
.change()
event.relatedTarget
.focus() .slideDown()
event.result
.focusin() .slideToggle()
event.stopImmediatePropagation()
.focusout() .slideUp()
event.stopPropagation()
.select()
event.target
.submit()
event.timeStamp
event.type
Keyboard Events event.which
.keydown()
.keypress()
.keyup()

https://oscarotero.com/jquery/ 4/5
13/12/2023, 11:08 jQuery Cheat Sheet

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()

CORE

jQuery Object Utilities DOM Element Methods


jQuery() jQuery.boxModel .get()
jQuery.noConflict() jQuery.browser .index()
jQuery.readyException() jQuery.contains() .size()
jQuery.sub() jQuery.each() .toArray()
jQuery.holdReady() jQuery.extend()
jQuery.when() jQuery.globalEval() Internals
jQuery.grep() .jquery
Deferred Object jQuery.inArray() .context
jQuery.Deferred() jQuery.isArray() jQuery.error()
deferred.always() jQuery.isEmptyObject() .length
deferred.done() jQuery.isFunction() .pushStack()
deferred.fail() jQuery.isNumeric() .selector
deferred.isRejected() jQuery.isPlainObject()
deferred.isResolved() jQuery.isWindow() Callbacks Object
deferred.notify() jQuery.isXMLDoc()
jQuery.Callbacks()
deferred.notifyWith() jQuery.makeArray()
callbacks.add()
deferred.pipe() jQuery.map()
callbacks.disable()
deferred.progress() jQuery.merge()
callbacks.disabled()
deferred.promise() jQuery.noop()
callbacks.empty()
deferred.reject() jQuery.now()
callbacks.fire()
deferred.rejectWith() jQuery.parseHTML()
callbacks.fired()
deferred.resolve() jQuery.parseJSON()
callbacks.fireWith()
deferred.resolveWith() jQuery.parseXML()
callbacks.has()
deferred.state() jQuery.proxy()
callbacks.lock()
deferred.then() jQuery.support
callbacks.locked()
.promise() jQuery.trim()
callbacks.remove()
jQuery.type()
jQuery.unique()
jQuery.uniqueSort()

https://oscarotero.com/jquery/ 5/5

You might also like