jquery 1.6 visual cheat sheet
TRANSCRIPT
-
8/6/2019 jQuery 1.6 Visual Cheat Sheet
1/4
Selects all elements.
Matches all elements with the given name.a
Selects all elements with the given t agname.
a
Selects a single element with the given idattribute.
a
Selects the combined results of all thespecified selectors.
a
Selects all direct child elements specified by"child" of elements specified by "parent".
a
Selects all elements that are descendants ofa given ancestor.
a
Selects all next elements matching "next"that are immediately preceded by a sibling"prev".
a
Selects all sibling elements that follow afterthe "prev" element, have the same parent,and match the filtering "siblings" selector.
a
Select all elements that are in the progressof an animation at the time the selector isrun.
a
Select the element at index n within thematched set.
a
Selects even elements, zero-indexeda
Selects the first matched element.a
Select all elements at an index greater thanindex within the matched set.
a
Selects all elements that are headers, likeh1, h2, h3 and so on.
a
Selects the last matched element.a
Select all elements at an index less than
index within the matched set.
a
Selects all elements that do not match thegiven selector.
a
Selects odd elements, zero-indexed. Seealso even.
a
Select all elements that contain thespecified text.
a
Select all elements that have no children(including text nodes).
a
Selects elements which contain at least oneelement that matches the specified selector.
a
Select all elements that are the parent ofanother element, including text nodes.
a
Selects elements that have the specifiedattribute with a value either equal to agiven string or starting with that string
followed by a hyphen (-).
a
Selects elements that have the specifiedattribute with a value containing the agiven substring.
a
Selects elements that have the specifiedattribute with a value containing a givenword, delimited by spaces.
a
Selects elements that have the specifiedattribute with a value ending exactly witha given string.
a
Selects elements that have the specifiedattribute with a value exactly equal to acertain value.
a
Select elements that either don't have thespecified attribute, or do have the specifiedattribute but not with a certain value.
a
^
Selects elements that have the specifiedattribute with a value beginning exactlywith a given string.
a
Selects elements that have the specifiedattribute, with any value.
a
Matches elements that match all of thespecified attribute filters.
a
Selects all elements that are the first childof their parent.
a
Selects all elements that are the last child oftheir parent.
a
Selects all elements that are the nth-child oftheir parent.
a
Selects all elements that are the only childof their parent.
a
Selects all elements that are hidden.a
Selects all elements that are visible.a
Selects all button elements and elements oftype button.
a
Selects all elements of type checkbox.a
Matches all elements that are checked.a
Selects all elements that are disabled.a
Selects all elements that are enabled.a
Selects element if it is currently focused.a
Selects all elements of type file.a
Selects all elements of type image.a
Selects all input, textarea, select and buttonelements.
a
Selects all elements of type password.a
Selects all elements of type radio.a
Selects all elements of type reset.a
Selects all elements that are selected.a
Selects all elements of type submit.a
Selects all elements of type text.a
Accepts a string containing a CSS selectorwhich is then used to match a set ofelements.
jQ
Creates a new copy of jQ whose propertiesand methods can be modified withoutaffecting the original jQuery object.
jQ
Provides a way to execute callback functionsbased on one or more objects, usually
Deferred objects that representasynchronous events.
Deferred
Relinquish jQuery's control of the $
variable.
Obj
Holds or releases the execution of jQuery'sready event.
0-1
Extends the jQuery object itself.jQ
The DOM node context originally passed tojQuery().
El
function(index, Element)
Iterate over a jQ object, executing a functionfor each matched element.
jQ
[ index ]
Retrieve the DOM elements matched by thejQuery object.
El | a
Search for a given element from among thematched elements.
Num
The number of elements in the jQuery object.
Num
A selector representing selector originallypassed to jQuery().
Str
Return the number of DOM elements matchedby the jQuery object.
Num
Retrieve all the DOM elements contained in thejQuery set, as an array.
a
[ queueName ], newQueue
Show the queue of functions to be executed onthe matched elements.
jQ
obj
Store arbitrary data associated with thematched elements.
jQ
[ name ]
Remove a previously-stored piece of data.jQ
[ queueName ]
Execute the next function on the queue for thematched elements.
jQ
Extends the jQuery element set to provide newmethods (used to make a typical jQuery
plugin).
jQ
Extends the jQuery object itself.
jQ
attributeName
Get the value of an attribute for the firstelement in the set of matched elements.
Str
attributeName, value
Set one or more attributes for the set ofmatched elements.
Obj
Remove an attribute from each element in theset of matched elements.
jQ
=NEW IN jQUERY 1.6 / f(x)=FUNCTION / a =ARRAY / jQ=jQUERY / El= ELEMENT / 0-1= BOOLEAN / Obj= OBJECT / NUM= NUMBER / Str= STRING
http://docs.jquery.com/Contributorshttp://docs.jquery.com/Contributorshttp://ejohn.org/http://ejohn.org/http://api.jquery.com/last-selector/http://api.jquery.com/last-selector/http://api.jquery.com/even-selector/http://api.jquery.com/even-selector/http://api.jquery.com/eq-selector/http://api.jquery.com/eq-selector/http://api.jquery.com/multiple-selector/http://api.jquery.com/multiple-selector/http://api.jquery.com/multiple-selector/http://api.jquery.com/multiple-selector/http://api.jquery.com/element-selector/http://api.jquery.com/element-selector/ -
8/6/2019 jQuery 1.6 Visual Cheat Sheet
2/4
propertyName
Get the value of a property for the first element inthe set of matched elements.
Str
propertyName,value
Set one or more properties for the set of matchedelements.
jQ
propertyName,value Remove a property for the set of matched elements
jQ
class
Adds the specified class(es) to each of the set ofmatched elements.
jQ
class
Determine whether any of the matched elementsare assigned the given class.
0-
1
class
Remove a single class, multiple classes, or allclasses from each element in the set of matchedelements.
jQ
class, switch
Add or remove one or more classes from eachelement in the set of matched elements, dependingon either the class's presence or the value of theswitch argument.
jQ
Get the HTML contents of the first element in theset of matched elements.
Str
htmlString
Set the HTML contents of each element in the set ofmatched elements.
jQ
Get the combined text contents of each element inthe set of matched elements, including theirdescendants.
Str
textString
Set the content of each element in the set ofmatched elements to the specified text.
jQ
Get the current value of the first element in the setof matched elements.
Str| a
value
Set the value of each element in the set of matchedelements.
jQ
propertyName
Get the value of a style property for the firstelement in the set of matched elements.
Str
propertyName, value
Set one or more CSS properties for the set ofmatched elements.
jQ
Get the current horizontal position of thescroll bar for the first element in the set ofmatched elements.
Int
value
Set the current horizontal position of thescroll bar for each of the set of matchedelements.
jQ
Get the current coordinates of the firstelement in the set of matched elements,relative to the document.
Obj
{top, left}
coordinates
Set the current coordinates of every elementin the set of matched elements, relative tothe document.
jQ
Get the current coordinates of the firstelement in the set of matched elements,relative to the offset parent.
Obj
{top, left}
Get the current vertical position of the scrollbar for the first element in the set ofmatched elements.
Int
value
Set the current vertical position of the scrollbar for each of the set of matched elements.
value
Set the CSS height of every matchedelement.
jQ
Get the current computed height for the firstelement in the set of matched elements.
Int
Get the current computed height for the firstelement in the set of matched elements,including padding but not border.
Int
Get the current computed width for the firstelement in the set of matched elements,including padding but not border.
Int
Get the current computed height for the firstelement in the set of matched elements,including padding, border, and optionallymargin.
Int
Get the current computed width for the firstelement in the set of matched elements,
including padding and border.
Int
value
Set the CSS width of each element in the set ofmatched elements.
jQ
Get the current computed width for the firstelement in the set of matched elements.
Int
- index
Reduce the set of matched elements to the one atthe specified index.
jQ
indexReduce the set of matched elements to the one at
the specified index.
jQ
selectorReduce the set of matched elements to those thatmatch the selector or pass the function's test.
jQ
selector
Check the current matched set of elementsagainst a selector, element, or jQuery object andreturn true if at least one of these elementsmatches the given arguments.
0-1
callback(index, domEl)
Pass each element in the current matched setthrough a function, producing a new jQueryobject containing the return values.
jQ
Remove elements from the set of matchedelements.
jQ
start, [ end ]
Reduce the set of matched elements to a subsetspecified by a range of indices.
jQ
[ selector ]
Get the children of each element in the set ofmatched elements, optionally filtered by aselector.
jQ
selector
Get the first ancestor element that matches theselector, beginning at the current element and
progressing up through the DOM tree.
jQ
selectors, [ context ]
Get the first ancestor element that matches theselector, beginning at the current element and
progressing up through the DOM tree.
a
selector
Get the descendants of each element in thecurrent set of matched elements, filtered by aselector, jQuery object, or element.
jQ
[ selector ]
Get the immediately following sibling of eachelement in the set of matched elements, optionally
filtered by a selector.
jQ
[ selector ]
Get all following siblings of each element in theset of matched elements, optionally filtered by aselector.
jQ
[ selector ]
Get all following siblings of each element up tobut not including the element matched by theselector.
jQ
Get the closest ancestor element that is
positioned.
jQ
[ selector ]
Get the parent of each element in the current setof matched elements, optionally filtered by aselector.
jQ
[ selector ]
Get the ancestors of each element in the currentset of matched elements, optionally filtered by aselector.
jQ
[ selector ]
Get the ancestors of each element in the currentset of matched elements, up to but not includingthe element matched by the selector.
jQ
[ selector ]
Get the immediately preceding sibling of eachelement in the set of matched elements, optionally
filtered by a selector.jQ
[ selector ]
Get all preceding siblings of each element in theset of matched elements, optionally filtered by aselector.
jQ
[ selector ]
Get the ancestors of each element in the currentset of matched elements, optionally filtered by aselector.
jQ
[ selector ]
Get the siblings of each element in the set ofmatched elements, optionally filtered by aselector.
jQ
Add elements to the set of matched elements.jQ
selectors, [ context ]
Add elements to the set of matched elements.jQ
Add the previous set of elements on the stack tothe current set.
jQ
Get the children of each element in the set ofmatched elements, including text nodes.
jQ
End the most recent filtering operation in thecurrent chain and return the set of matchedelements to its previous state.
jQ
content
Insert content, specified by the parameter, to theend of each element in the set of matchedelements.
jQ
function(index, html)Insert content, specified by the parameter, to theend of each element in the set of matchedelements.
jQ
target
Insert every element in the set of matchedelements to the end of the target.
jQ
content
Insert content, specified by the parameter, to thebeginning of each element in the set of matchedelements.
jQ
target
Insert content, specified by the parameter, to theend of each element in the set of matchedelements.
jQ
content
Insert content, specified by the parameter, aftereach element in the set of matched elements.
jQ
function(index)
Insert content, specified by the parameter, to theend of each element in the set of matchedelements.
jQ
content
Insert content, specified by the parameter, beforeeach element in the set of matched elements.
jQ
function
Insert content, specified by the parameter, beforeeach element in the set of matched elements.
jQ
=NEW IN jQUERY 1.6 / f(x)=FUNCTION / a =ARRAY / jQ=jQUERY / El= ELEMENT / 0-1= BOOLEAN / Obj= OBJECT / NUM= NUMBER / Str= STRING
http://docs.jquery.com/Contributorshttp://docs.jquery.com/Contributorshttp://ejohn.org/http://ejohn.org/http://api.jquery.com/prop/http://api.jquery.com/prop/http://api.jquery.com/prop/http://api.jquery.com/prop/http://api.jquery.com/prop/http://api.jquery.com/prop/ -
8/6/2019 jQuery 1.6 Visual Cheat Sheet
3/4
target
Insert every element in the set of matchedelements after the target.
jQ
target
Insert every element in the set of matchedelements before the target.
jQ
Remove the parents of the set of matchedelements from the DOM, leaving the matchedelements in their place.
jQ
wrappingElement
Wrap an HTML structure around each element inthe set of matched elements.
jQ
wrappingFunction
Wrap an HTML structure around each element inthe set of matched elements.
jQ
wrappingElement
Wrap an HTML structure around all elements inthe set of matched elements.
jQ
wrappingElement
Wrap an HTML structure around the content ofeach element in the set of matched elements.
jQ
wrappingFunction
Wrap an HTML structure around the content ofeach element in the set of matched elements.
jQ
newContent
Replace each element in the set of matchedelements with the provided new content.
jQ
function
Replace each element in the set of matchedelements with the provided new content.
jQ
A selector expression indicating which element(s)to replace.
jQ
[ selector ]
Remove the set of matched elements from theDOM.
jQ
Remove all child nodes of the set of matchedelements from the DOM.
jQ
[ selector ]
Remove the set of matched elements from theDOM.
jQ
[ withDataAndEvents ]
Create a deep copy of the set of matchedelements.
jQ
handler(eventObject)Bind an event handler to t he "load" JavaScriptevent.
jQ
handler
Specify a function to execute when the DOM isfully loaded.
jQ
handler(eventObject)
Bind an event handler to t he "unload" JavaScriptevent.
jQ
eventType, [ eventData ], handler
(eventObject)
Attach a handler to an event for the elements.
jQ
selector, eventType,handler
Attach a handler to one or more events for allelements that match the selector, now or in the
future, based on a specific set of root elements.
jQ
Remove all event handlers previously attachedusing .live() from the elements.
jQ
eventType, eventData, handler
Attach a handler to the event for all elementswhich match the current selector, now or in the
future.
jQ
eventType, [ eventData ], handler(eventObject)
Attach a handler to an event for the elements.The handler is executed at most once per element.
jQ
eventType, extraParameters
Execute all handlers and behaviors attached tothe matched elements for the given event type.
jQ
eventType,extraParameters
Execute all handlers attached to an element foran event.
jQ
eventType, handler(eventObject)
Remove a previously-attached event handlerfrom the elements.
jQ
Remove a handler from the event for all elementswhich match the current selector, now or in the
future, based upon a specific set of root elements.
jQ
handler(eventObject)
Bind an event handler to t he "click" JavaScriptevent, or trigger that event on an element.
jQ
handler(eventObject)
Bind an event handler to the "dblclick"JavaScript event, or trigger that event on anelement.
jQ
handler(eventObject)
Bind an event handler to t he "focusin" JavaScriptevent.
jQ
handler(eventObject)
Bind an event handler to the "focusout"JavaScript event.
jQ
handlerIn(eventObject),handlerOut(eventObject)
Bind two handlers to the matched elements, to beexecuted when the mouse pointer enters andleaves the elements.
jQ
handler(eventObject)
Bind a single handler to the matched elements, to
be executed when the mouse pointer enters orleaves the elements.
jQ
handler(eventObject)
Bind an event handler to the "mousedown"JavaScript event, or trigger that event on anelement.
jQ
handler(eventObject)
Bind an event handler to be fired when themouse enters an element, or trigger that handleron an element.
jQ
handler(eventObject)
Bind an event handler to be fired when themouse leaves an element, or trigger that handleron an element.
jQ
handler(eventObject)
Bind an event handler to the "mousemove"JavaScript event, or trigger that event on anelement.
jQ
handler(eventObject)
Bind an event handler to the "mouseout"JavaScript event, or trigger that event on anelement.
jQ
handler(eventObject)
Bind an event handler to the "mouseover"JavaScript event, or trigger that event on anelement.
jQ
handler(eventObject)
Bind an event handler to the "mouseup"JavaScript event, or trigger that event on anelement.
jQ
handler(eventObject)
Bind an event handler to t he "blur" JavaScriptevent, or trigger that event on an element.
jQ
handler(eventObject)
Bind an event handler to the "change"JavaScript event, or trigger that event on an
element.
jQ
handler(eventObject)
Bind an event handler to t he "focus" JavaScriptevent, or trigger that event on an element.
jQ
handler(eventObject)
Bind an event handler to t he "select" JavaScriptevent, or trigger that event on an element.
jQ
handler(eventObject)
Bind an event handler to t he "submit" JavaScriptevent, or trigger that event on an element.
jQ
handler(eventObject)
Bind an event handler to the "keydown"JavaScript event, or trigger that event on an
element.
jQ
handler(eventObject)
Bind an event handler to the "keypress"JavaScript event, or trigger that event on anelement.
jQ
handler(eventObject)Bind an event handler to t he "keyup" JavaScriptevent, or trigger that event on an element.
jQ
The current DOM element within the eventbubbling phase.
El
Contains the optional data passed tojQuery.fn.bind when the current executinghandler was bound.
Returns whether event.preventDefault() wasever called on this event object.
0-1
Returns whetherevent.stopImmediatePropagation() was evercalled on this event object.
0-1
Returns whether event.stopPropagation() wasever called on this event object.
0-1
The mouse position relative to the left edge ofthe document.
Num
The mouse position relative to the top edge ofthe document.
Num
If this method is called, the default actionof the event will not be triggered.
The other DOM element involved in the event,if any.
El
This attribute contains the last value returnedby an event handler that was triggered by thisevent, unless the value was undefined.
Obj
Prevents other event handlers from beingcalled.
Prevents the event from bubbling up the DOMtree, preventing any parent handlers frombeing notified of the event.
The DOM element that initiated the event.El
This attribute returns the number ofmilliseconds since January 1, 1970, when theevent is triggered.
Num
Describes the nature of the event.Str
For key or button events, this attribute
indicates the specific button or key that waspressed.
Str
handler(eventObject)
Bind an event handler to the "error"JavaScript event.
jQ
handler(eventObject)
Bind an event handler to the "resize"JavaScript event, or trigger that event on anelement.
jQ
handler(eventObject)
Bind an event handler to the "scroll"JavaScript event, or trigger that event on anelement.
jQ
Anything
=NEW IN jQUERY 1.6 / f(x)=FUNCTION / a =ARRAY / jQ=jQUERY / El= ELEMENT / 0-1= BOOLEAN / Obj= OBJECT / NUM= NUMBER / Str= STRING
http://docs.jquery.com/Contributorshttp://docs.jquery.com/Contributorshttp://ejohn.org/http://ejohn.org/ -
8/6/2019 jQuery 1.6 Visual Cheat Sheet
4/4
duration, [ callback ]
Hide the matched elements.jQ
duration, [ callback ]
Display the matched elements.jQ
[ duration ], [ callback ]
Display the matched elements with a slidingmotion.
jQ
[ duration ], [ callback ]
Display or hide the matched elements with asliding motion.
jQ
[ duration ], [ callback ]
Hide the matched elements with a slidingmotion.
jQ
[ duration ], [ callback ]
Display the matched elements by fading themto opaque.
jQ
[ duration ], [ callback ]
Hide the matched elements by fading them totransparent.
jQ
duration, opacity, [ callback ]
Adjust the opacity of the matched elements.jQ
properties, options
Perform a custom animation of a set of CSSproperties.
jQ
duration, [ queueName ]
Set a timer to delay execution of subsequentitems in the queue.
jQ
[ clearQueue ], [ jumpToEnd ]
Stop the currently-running animation on thematched elements.
jQ
Globally disable all animations.0-1
url, [ settings ]
Perform an asynchronous HTTP (Ajax)request.
jqXHR
settingsPerform an asynchronous HTTP (Ajax)request.
jqXHR
option
Set default values for future Ajax requests.0-1
url, [ data ], [ callback(data,textStatus, XMLHttpRequest) ],
[ dataType ]
Load data from the server using a HTTP GETrequest.
jqXHR
url, [ data ],
[ callback(data, textStatus) ]
Load JSON-encoded data from the serverusing a GET HTTP request.
jqXHR
url, [ success(data,textStatus) ]
Load a JavaScript file from the server using aGET HTTP request, then execute it.
jqXHR
url, [ data ], [ complete(responseText, textStatus,
XMLHttpRequest) ]
Load data from the server and place thereturned HTML into the matched element.
jQ
url, [ data ], [ success(data, textStatus, XMLHttpRequest) ],
[ dataType ]
Load data from the server using a HTTP POSTrequest.
jqXHR
handler(event,
XMLHttpRequest, ajaxOptions)
Register a handler to be called when Ajaxrequests complete.
jQ
handler()
Register a handler to be called when the firstAjax request begins.
jQ
handler()
Hide a loading message after all the Ajaxrequests have stopped.
jQ
handler(event,XMLHttpRequest, ajaxOptions,
thrownError)
Register a handler to be called when Ajaxrequests complete with an error.
jQ
handler(event,
XMLHttpRequest, ajaxOptions)
Show a message before an Ajax request is sent.
jQ
handler(event,
XMLHttpRequest, ajaxOptions)
Show a message when an Ajax requestcompletes successfully.
jQ
Encode a set of form elements as a string forsubmission.
Str
Encode a set of form elements as an array ofnames and values.
a
Contains flags for the useragent, read fromnavigator.userAgent. While jQuery.browser willnot be removed from future versions of jQuery,every effort to use jQuery.support and proper
feature detection should be made.
ap
Returns the version number of the renderingengine for the user's browser.
Str
container, contained
Check to see if a DOM node is within anotherDOM node.
0-1
collection, callback
(indexInArray, valueOfElement)
Iterates through the array displaying eachnumber as both a word and numeral
Obj
target, [ object1 ],[ objectN ]
Merge the contents of two or more objectstogether into the first object.
Obj
code
Execute some JavaScript code globally.
elementDetermine whether an element has any jQuerydata associated with it.
0-1
array, function(elementOfArray, indexInArray),[ invert ]
Finds the elements of an array which satisfy afilter function. The original array is not affected.
a
value, array
Search for a specified value within an array andreturn its index (or -1 if not found).
Num
obj
Determine whether the argument is an array.0-1
objCheck to see if an object is empty (contains no
properties).
0-1
obj
Determine if the argument passed is a Javascriptfunction object.
0-1
obj
Check to see if an object is a plain object(created using "{}" or "new Object").
0-1
node
Check to see if a DOM node is within an XMLdocument (or is an XML document).
0-1
obj
Convert an array-like object into a trueJavaScript array.
a
array, callback(elementOfArray, indexInArray)
Translate all items in an array or object tonew array of items.
a
first, secondMerge the contents of two arrays togetherinto the first array.
a
An empty function.
json
Takes a well-formed JSON string andreturns the resulting JavaScript object.
Obj
function, context
Takes a function and returns a new one thatwill always have a particular context.
f(x)
element,[ queueName ]
Show the queue of functions to be executedon the matched element.
a
element, queueName,
newQueue
Show the queue of functions to be executedon the matched element.
a
element,[ name ]
Remove a previously-stored piece of data.
jQ
A collection of properties that represent thepresence of different browser features orbugs.
Obj
str
Remove the whitespace from the beginningand end of a string.
Obj
data
Parses a string into an XML document.XMLdoc
Sorts an array of DOM elements, in place,with the duplicates removed.
jQ
doneCallbacks
Add handlers to be called when the Deferredobject is resolved.
Def
failCallbacks
Add handlers to be called when the Deferred
object is rejected.
Def
Determine whether a Deferred object has beenrejected.
0-1
Determine whether a Deferred object has beenresolved.
0-1
Return a Deferred's Promise object.Def
args
Reject a Deferred object and call anyfailCallbacks with the given args.
Def
context [args]
Reject a Deferred object and call anyfailCallbacks with the given context and args.
Def
args
Resolve a Deferred object and call anydoneCallbacks with the given args.
Def
args
Resolve a Deferred object and call anydoneCallbacks with the given context and args.
Def
doneCallbacks
failCallbacks
Add handlers to be called when the Deferredobject is resolved or rejected.
Def
alwaysCallbacks
Add handlers to be called when the Deferredobject is either resolved or rejected.
Def
[ doneFilter ],[ failFilter ]
Utility method to filter and/or chain Deferreds.
[ type ], [ target ]
Return a Promise object to observe when allactions of a certain type bound to the collection,queued or not, have finished.
=NEW IN jQUERY 1.6 / f(x)=FUNCTION / a =ARRAY / jQ=jQUERY / El= ELEMENT / 0-1= BOOLEAN / Obj= OBJECT / NUM= NUMBER / Str= STRING / = PROMISE
http://docs.jquery.com/Contributorshttp://docs.jquery.com/Contributorshttp://ejohn.org/http://ejohn.org/http://api.jquery.com/Types/#jqXHRhttp://api.jquery.com/Types/#jqXHRhttp://api.jquery.com/Types/#jqXHRhttp://api.jquery.com/Types/#jqXHRhttp://api.jquery.com/Types/#jqXHRhttp://api.jquery.com/Types/#jqXHRhttp://api.jquery.com/Types/#jqXHRhttp://api.jquery.com/Types/#jqXHRhttp://api.jquery.com/Types/#jqXHRhttp://api.jquery.com/Types/#jqXHRhttp://api.jquery.com/Types/#jqXHRhttp://api.jquery.com/Types/#jqXHR