jQuery Traversing - Examples



Learn how to play with traversing in jQuery. Here are most commonly used examples −

  1. How to reduce the set of matched elements to a single element?

  2. How to remove all elements from the set of matched elements that do not match the specified selector(s)?

  3. How to remove all elements from the set of matched elements that do not match the specified function?

  4. How to check the current selection against an expression and returns true, if at least one element of the selection fits the given selector?

  5. How to translate a set of elements in the jQuery object into another set of values in a jQuery array (which may, or may not contain elements)?

  6. How to remove elements matching the specified selector from the set of matched elements?

  7. How to select a subset of the matched elements?

  8. How to add more elements, matched by the given selector, to the set of matched elements?

  9. How to add the previous selection to the current selection?

  10. How to get a set of elements containing all of the unique immediate children of each of the matched set of elements?

  11. How to get a set of elements containing the closest parent element that matches the specified selector, the starting element included?

  12. How to find all the child nodes inside the matched elements (including text nodes), or the content document, if the element is an iframe?

  13. How to revert the most recent 'destructive' operation, changing the set of matched elements to its previous state?

  14. How to search for descendent elements that match the specified selectors?

  15. How to get a set of elements containing the unique next siblings of each of the given set of elements?

  16. How to find all sibling elements after the current element?

  17. How to return a jQuery collection with the positioned parent of the first matched element?

  18. How to get the direct parent of an element? If called on a set of elements, parent returns a set of their unique direct parent elements?

  19. How to get a set of elements containing the unique ancestors of the matched set of elements (except for the root element)?

  20. How to get a set of elements containing the unique previous siblings of each of the matched set of elements?

  21. How to find all sibling elements in front of the current element?

  22. How to get a set of elements containing all of the unique siblings of each of the matched set of elements?

Advertisements