sibling
A node that shares the same parent as another node in the DOM tree.
In more detail
nextElementSibling and previousElementSibling move between neighbouring elements. In events, sibling listeners are other listeners registered on the same element.
Related terms
- ancestor — Any node above a given node in the DOM tree: its parent, the parent's parent and so on up to the document.
- descendant — Any node below a given node in the DOM tree: its children, their children and so on.
- element traversal properties — DOM properties such as children, firstElementChild and nextElementSibling that move between elements while skipping text and comment nodes.
Taught in
- Modern DOM Querying: querySelector, closest And matches — Frontend Architecture & Web Platform
- Modern Selectors: :has(), :is(), :where() And Nesting Standards — Frontend Architecture & Web Platform
- Event Phases: Capturing, Target And Bubbling Demystified — Frontend Architecture & Web Platform