Traversal
Traverse the DOM tree.
-
.childNodes
the child nodes of an element
-
.children
the child elements of an element
-
.closest()
closest inclusive ancestor
-
.firstElementChild
the first element child of the node
-
.lastElementChild
the last element child of the node
-
.matches()
if an element matches a selector
-
.nextElementSibling
the following sibling
-
.parentElement
the parent element
-
.previousElementSibling
the preceding sibling
-
.query()
finds the first element matching selectors
-
.queryAll()
finds all the elements matching selectors
-
.textContent
text content of a node