Search within TutorialsPark

Jquery Selector Reference


Learn to use jQuery events that are triggered by Form Event


jQuery Events: Form Events

jQuery has a set of methods to use and handle Form related events.

Table : Filtering Methods

Methods Description
.filter(selector) To return a jQuery object containing selected elements that match the given selector.
.filter(callback) To return a jQuery object containing selected elements for which the callback function return true.
.eq(index) To return a jQuery object containing selected elements at the given 0-based index.
.first() To return a jQuery object containing the first selected element.
.last() To return a jQuery object containing the final selected element.
.slice(start, {end}) To return a jQuery object containing selected elements in the given range of 0-based indices.
.not(selector) To return a jQuery object containing selected elements that do not match the given selector.
.has(selector) To return a jQuery object containing selected elements that have a descendant matching selector.

Table : Descendants Methods

Method Description
.find(selector) To return a jQuery object containing descendant elements the match the selector.
.contents() To return a jQuery object containing child nodes(including text nodes)
.children(selector) To return a jQuery object containing child nodes, optionally filtered by a selector.

Table : Sibling Reference

Method Description
.next([selector]) To return a jQuery object containing the sibling immediately following each selected element, optionally filtered by a selector.
.nextAll([selector]) To return a jQuery object containing all siblings following each selected element, optionally filtered by a selector.
.nextUntil([selector],[filter]) To return a jQuery object containing all sibling following each selected element up to and not including the first element matching selector, optionally filtered by an additonal selector.
.prev([selector]) To return a jQuery object containing the sibling immediately preceding each selected element, optionally filtered by a selector.
.prevAll([selector]) To return a jQuery object containing all sibling preceding each selected element, optionally filtered by a selector.
.prevUntil([selector],[filter]) To return a jQuery object containing all siblings preceding each selected element up to and not including the first element matching selector, optionally filtered by an additonal selector.
.siblings([selector]) To return a jQuery object containing all siblings, optionally filtered by a selector.

Table : Ancestor Methods

Method Description
.parent([selector]) To return a jQuery object containing the parent of each selected element, optionally filtered by a selector.
.parents([selector]) To return a jQuery object containing all ancestor, optionally filtered by a selector.
.parentsUntil([selector],[filter]) To return a jQuery object containing all ancestors of each selected element up to and not including the first element matching selector, optionally filtered by an additonal selector.
.closest([selector]) To return a jQuery object containing the first element that matches the selector, starting at the selected element and moving up through its ancestors in the DOM tree.
.offsetParent() To return a jQuery object containing the positioned parent, either relative or absolute of the first selected element.

Table : Collection Manipulation

Methods Description
.add(selector) To return a jQuery object containing the selected elements, plus any additonal elements that match the given selector
.addback() To return a jQuery object containing the selected elements, plus the previous set of selected elements on the internal jQuery stack
.end() To return a jQuery object containing the previous set of selected elements on the internal jQuery stack.
.map(callback) To return a jQuery object containing the result of the callback function when called on each selected element.
.pushStack(elements) To return a jQuery object containing the specified elements.

Table : Working with Selected Elements

Method Description
.is(selector) To determine whether any matched element is matched by the given selector expression.
.index() To get the index of the matched element in relation to its siblings.
.index(element) To get the index of the given DOM node within the set of matched elements.
$.contains(a, b) To determine whether DOM node b contains DOM node a.
.each(callback) To iterates over the matched elements, executing callback for each element
.length To get the number of matched elements
.get() To get an array of DOM nodes corresponding to the matched elements
.get(index) To get the DOM node corresponding to the matched element at the fiven index.
.toArray() To get an array of DOM nodes corresponding to the matched elements.