Definition:
Node An interface is an abstract base class for many DOM API objects, enabling consistent interaction across object types.Node do not exist; subclasses implement its functionality (e.g., Document, Element, DocumentFragment).Attr, CharacterData (e.g., Text, Comment), and DocumentType are based on Node.Key Features:
Node Features may not apply to child interfaces, potentially returning null or throwing exceptions (e.g., adding children to a node that cannot have children).Properties:
Node Objects inherit properties and methods from EventTarget.Node.baseURI (Read-only): Base URL of the document.Node.childNodes (Read-only): Live NodeList of child nodes.Node.firstChild / Node.lastChild (Read-only): First/last direct child node.Node.isConnected (Read-only): Boolean indicating connection to a document or shadow DOM.Node.nextSibling / Node.previousSibling (Read-only): Adjacent sibling nodes.Node.nodeName (Read-only): Name of the node (varies by type).Node.nodeType (Read-only): Type of the node (e.g., ELEMENT_NODE, TEXT_NODE).Node.nodeValue: Value of the node (read/write).Node.ownerDocument (Read-only): Document owning the node, or null for documents themselves.Node.parentNode / Node.parentElement (Read-only): Parent Node or Element.Node.textContent: Textual content of the node and descendants (read/write).Methods:
Node.appendChild(childNode): Adds a child node to the end of the list.Node.cloneNode(deep): Creates a duplicate of the node (with optional deep cloning).Node.compareDocumentPosition(otherNode): Compares the position of two nodes.Node.contains(anotherNode): Checks if the node contains another node.Node.getRootNode(): Returns the root node, including shadow root if present.Node.hasChildNodes(): Boolean indicating the presence of child nodes.Node.insertBefore(newNode, referenceNode): Inserts a node before a reference node.