plainJS

Functions / Traversing

Traversing

DOM traversing. 5 snippets.

  1. Get closest element by selector$.closest()
  2. Get parent element node$.parent(), $.parents()
  3. Get siblings of an element$.siblings(), $.next(), $.nextAll(), $.prev, $.prevAll()
  4. Match element selector$.is()
  5. Select the children of an element$.children()

The other groups: