Quick Reference
This is a quick reference list of jQuery Traversing Methods that are used to move through the selected elements.
- jQuery – children() MethodThe children() method returns all direct children of the selected element.
- jQuery – closest() MethodThe closest() method returns the first ancestor of the selected element.
- jQuery – contents() MethodThe contents() method returns all direct children, including text and comment nodes, of the selected element.
- jQuery – each() MethodThe each() method specifies a function to run for each matched element.
- jQuery – eq() MethodThe eq() method returns an element with a specific index number of the selected elements. 0 for element 1, 1 for element 2, 2, for element 3, etc.
- jQuery – filter() MethodThe filter() method returns elements that match a certain criteria. Elements that don’t match the criteria are removed from the selection.
- jQuery – find() MethodThe find() method returns descendant elements of the selected element.
- jQuery – first() MethodThe first() method returns the first element of the selected elements.
- jQuery – has() MethodThe has() method returns all elements that have one or more elements inside of them, that matches the specified selector.
- jQuery – is() MethodThe is() method checks if one of the selected elements matches the selectorElement.
- jQuery – last() MethodThe last() method returns the last element of the selected elements.
- jQuery – next() MethodThe next() method returns the next sibling element of the selected element.
- jQuery – nextAll() MethodThe nextAll() method returns ALL next sibling elements of the selected element.
- jQuery – nextUntil() MethodThe nextUntil() method returns all next sibling elements between the selector and stop. If both parameters are empty, it will return ALL next siblings.
- jQuery – not() MethodThe not() method returns elements that do NOT match a certain criteria. Elements that DO match are removed.
- jQuery – offsetParent() MethodThe offsetParent() method returns the first positioned parent element.
- jQuery – parent() MethodThe parent() method returns the direct parent element of the selected element.
- jQuery – parents() MethodThe parents() method returns all ancestor elements (parent, grandparent, great-grandparent, and so on) of the selected element.
- jQuery – parentsUntil() MethodThe parentsUntil() method returns all ancestor elements(parent, grandparent, great-grandparent, and so on) between the selector and stop.
- jQuery – prev() MethodThe prev() method returns the previous sibling element of the selected element.
- jQuery – prevAll() MethodThe prevAll() method returns all previous sibling elements of the selected element.
- jQuery – prevUntil() MethodThe prevUntil() method returns all previous sibling elements between the selector and stop.
- jQuery – siblings() MethodThe siblings() method returns all sibling elements of the selected element.
- jQuery – slice() MethodThe slice() method selects a subset of elements based on its index number.
jQuery Notes:
- To use jQuery on your site, it must first be downloaded from the official jQuery site and linked to in your document <head>, or linked to via a CDN in your document <head>
- It is generally good practice to place your jQuery code/function inside the document load function so that the action takes place ONLY after the document has finished loading
- When using jQuery, single or double quotation marks are acceptable and work identically to one another; choose whichever you prefer, and stay consistent
We’d like to acknowledge that we learned a great deal of our coding from W3Schools and TutorialsPoint, borrowing heavily from their teaching process and excellent code examples. We highly recommend both sites to deepen your experience, and further your coding journey. We’re just hitting the basics here at 1SMARTchicken.