DollarJS API

DollarJS can be used like an Array

$('div')[0]
$('div').length
$('div').forEach(function(elem){ console.log(elem); })
$('div').indexOf(elem)
$('div').push(elem)
$('div').pop()
$('div').unshift(elem)
$('div').shift()
$('div').slice(1, 3)

core

.closest( ) Find the closest ancestor that matches a given selector
.each( ) Iterate over each matched element
.eq( ) Reduce the matched set to the one element at a specific index
.filter( ) Reduce the matched set to the ones that match an additional selector
.find( ) Get the descendants of each element in the matched set that match a given selector
.get( ) Return the actual element at a given index
.reverse( ) Reverse the set of matched elements

animate

.animate( ) Animate styles using CSS transitions
.fadeIn( ) Slowly fade the matched elements into view
.fadeOut( ) Hide the matched elements by slowly fading away

filter

.add( ) Add elements that match a new selector to the current set
.concat( ) Merge an Array of Elements into the current set
.has( ) Reduce the set of matched elements to those that have a descendant that matches a new selector
.is( ) Is the current set of elements a match to a new selector?
.map( ) Create a new set by calling a function on every element in the current set
.not( ) Remove elements from the current set that match a new selector

mutate

.after( ) Insert content after each element in the current set
.append( ) Insert content into each element in the current set (at the bottom)
.before( ) Insert content before each element in the current set
.clone( ) Clone each element in the current set
.empty( ) Empty the contents of each element in the current set
.html( ) Get or set the HTML contents of the current set
.prepend( ) Insert content into each element in the current set (at the top)
.remove( ) Remove each element in the current set from the document

readwrite

.attr( ) Get or set attributes on the current set
.data( ) Store or read arbitrary data associated with the matched elements
.prop( ) Get or set properties on the current set
.removeAttr( ) Remove an attribute from each element in the current set
.removeData( ) Unset data from each element in the current set
.removeProp( ) Remove a property from each element in the current set
.text( ) Get or set text contents on the current set
.val( ) Get or set a value on the current set

style

.addClass( ) Add classes to each element in the current set
.css( ) Get or set the style of each element in the current set
.hasClass( ) Do any of the matched elements have the given class name?
.height( ) Get the current height of the first element in the set
.hide( ) Hide each element in the current set
.removeClass( ) Remove classes from each element in the current set
.show( ) Display each element in the current set
.width( ) Get the current width of the first element in the set

traverse

.children( ) Get the children of each element in the current set
.first( ) Reduce the set of matched elements to the first in the set
.last( ) Reduce the set of matched elements to the last in the set
.next( ) Get the next sibling of each element in the current set
.parent( ) Get the parents of each element in the current set
.prev( ) Get the previous sibling of each element in the current set
.siblings( ) Get the siblings of each element in the current set

trigger

.click( ) Handle a "click" event on any element in the current set
.focus( ) Handle a "focus" event on any element in the current set
.blur( ) Handle a "blur" event on any element in the current set
.change( ) Handle a "change" event on any element in the current set
.resize( ) Handle a "resize" event on any element in the current set
.off( ) Unbind some event handler from each element in the current set
.on( ) Bind some event handler to each element in the current set
.trigger( ) Trigger events on each element in the current set

$.utils

.utils.each( ) Iterate over each item in a collection
.utils.extend( ) Extend a target object with additional objects