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

Wsu Jquery Cheat Sheet

This document provides a concise summary of jQuery selectors, attributes/CSS manipulation, event handling, effects, AJAX functionality, and core jQuery methods in 3 sentences or less per section. It begins with a table of contents and covers essential jQuery topics like selecting elements, manipulating attributes and styles, traversing the DOM, attaching event handlers, animating effects, making AJAX requests, and using core jQuery utilities and objects.

Uploaded by

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

Wsu Jquery Cheat Sheet

This document provides a concise summary of jQuery selectors, attributes/CSS manipulation, event handling, effects, AJAX functionality, and core jQuery methods in 3 sentences or less per section. It begins with a table of contents and covers essential jQuery topics like selecting elements, manipulating attributes and styles, traversing the DOM, attaching event handlers, animating effects, making AJAX requests, and using core jQuery utilities and objects.

Uploaded by

M. A. Haque
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

Beginner’s essential

jQuery Cheat Sheet

Write less, and do more!


An essential tool for rapid web development.

#################
TABLE OF CONTENTS

Selectors 3
Attributes / CSS 5
Manipulation 6
Traversing 7
Events 8
Effects 10
AJAX 11
Core 12

2 of 13
SELECTORS
Basics :target

*
Content Filters
.class
:contains()
element
:empty
#id
:has()
selector1, selectorN, …
:parent

Heirarchy
Visibility Filters
parent > child
:hidden
ancestor descendant
:visible
prev + 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-child Forms
: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() :file

length :image

% :input

border-box | padding-box | :password


content-box | no-clip
:radio

:reset

:selected

:submit

:text

4 of 13
.offset()
ATTRIBUTES / CSS
.offsetParent()
Attributes .position()
.attr()
.scrollLeft()
.prop()
.scrollTop()
.removeAttr()

.removeProp() Data
.val() jQuery.data()

.data()
CSS jQuery.hasData()
.addClass()
jQuery.removeData()
.css()
.removeData()

jQuery.cssHooks

jQuery.cssNumber

jQuery.escapeSelector()

.hasClass()

.removeClass()

.toggleClass()

Dimensions
.height()

.innerHeight()

.innerWidth()

.outerHeight()

.outerWidth()

.width()

Offset
5 of 13
.unwrap()
MANIPULATION

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
.nextUntil()
TRAVERSING
.parent()
Filtering .parents()
.eq()
.parentsUntil()
.filter()
.prev()
.first()
.prevAll()
.has()
.prevUntil()
.is()
.siblings()

.last()

.map()

.not()

.slice()

Miscellaneous Traversing
.add()

.addBack()

.andSelf()

.contents()

.each()

.end()

Tree Traversal
.children()

.closest()

.find()

.next()

.nextAll()

7 of 13
.focus()
EVENTS
.focusin()
Browser Events .focusout()
.error()
.select()
.resize()
.submit()
.scroll()

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

Mouse Events
Event Handler Attachment .click()
.bind()
.contextMenu()
.delegate()
.dblclick()
.die()
.hover()
.live()
.mousedown()
.off()
.mouseenter()
.on()
.mouseleave()
.one()
.mousemove()
.trigger()
.mouseout()
.triggerHandler()
.mouseover()
.unbind()
.mouseup()
.undelegate()
.toggle()

Form Events
Event Object
.blur()
event.currentTarget
.change()
event.delegateTarget
8 of 13
event.data

event.isDefaultPrevented()

event.isImmediatePropagationStop
ped()

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
Sliding
EFFECTS
.slideDown()
Basics .slideToggle()
.hide()
.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
.promise()
CORE

jQuery Object Utilities


jQuery() jQuery.boxModel

jQuery.noConflict() jQuery.browser

jQuery.sub() jQuery.contains()

jQuery.holdReady() jQuery.each()

jQuery.when() jQuery.extend()

jQuery.globalEval()
Deferred Object jQuery.grep()
jQuery.Deferred()
jQuery.inArray()
deferred.always()
jQuery.isArray()
deferred.done()
jQuery.isEmptyObject()
deferred.fail()
jQuery.isFunction()
deferred.isRejected()
jQuery.isNumeric()
deferred.isResolved()
jQuery.isPlainObject()
deferred.notify()
jQuery.isWindow()
deferred.notifyWith()
jQuery.isXMLDoc()
deferred.pipe()
jQuery.makeArray()
deferred.progress()
jQuery.map()
deferred.promise()
jQuery.merge()
deferred.reject()
jQuery.noop()
deferred.rejectWith()
jQuery.now()
deferred.resolve()
jQuery.parseHTML()
deferred.resolveWith()
jQuery.parseJSON()
deferred.state()
jQuery.parseXML()
deferred.then()
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

You might also like