Web APIs
Node.childNodes
A document is a tree of nodes. Elements are one kind of node; text and comments are nodes too. children lists element children, while childNodes includes text and comments.
Formal Syntax & Structure
javascript syntaxjavascript
node.childNodesReturn Value
NodeList
Live collection of child nodes.
Working Example
Example Snippetjavascript
const p=document.createElement("p"); p.append("Hello",document.createElement("strong")); console.log(p.childNodes.length,p.children.length);