Which property is used to access the parent node of an element?
Analysis & Theory
`parentNode` returns the immediate parent of the node.
Which property is used to access all child nodes of an element, including text and comment nodes?
Analysis & Theory
`childNodes` returns a NodeList of all child nodes, including text and comment nodes.
Which property accesses the next sibling node of a DOM element?
Analysis & Theory
`nextSibling` returns the next node at the same level, regardless of type.
Which property accesses the previous sibling **element** (ignores text nodes)?
Analysis & Theory
`previousElementSibling` returns only element siblings, skipping text or comment nodes.
Which property gives the first child that is an element (not text)?
Analysis & Theory
`firstElementChild` skips text and comment nodes and returns the first child that is an element.
How can you access only the element children of a node?
Analysis & Theory
`children` returns only element nodes, excluding text, comment, and attribute nodes.
What does `document.documentElement` return?
B
The root `<html>` element
Analysis & Theory
`document.documentElement` refers to the root `<html>` element of the document.
Which property gives the last child node of an element?
Analysis & Theory
`lastChild` returns the last child node, which may be text, comment, or element.
What is the difference between `nextSibling` and `nextElementSibling`?
B
`nextSibling` includes all node types; `nextElementSibling` only elements
C
`nextSibling` skips comments
D
`nextElementSibling` includes text nodes
Analysis & Theory
`nextSibling` returns any node type, including text; `nextElementSibling` returns only elements.
Which property helps in navigating from a child node back to its parent element?
Analysis & Theory
`parentNode` allows you to move from a child node to its parent in the DOM tree.