The node that can be a parent of another node.

Node on MDN

interface ParentNode {
    childElementCount: number;
    children: readonly Node[];
    firstChild: null | ChildNode;
    firstElementChild: null | Element;
    lastChild: null | ChildNode;
    lastElementChild: null | Element;
    nextSibling: null | ChildNode;
    nodeName: string;
    nodeType: number;
    parentNode: null | ParentNode;
    previousSibling: null | ChildNode;
    get childNodes(): readonly ChildNode[];
    nodeValue: null | string;
    get parentElement(): null | Element;
    textContent: null | string;
    append(...nodes: (string | Node)[]): this;
    appendChild<T>(node: T): T;
    cloneNode(deep?: boolean): ParentNode;
    contains(node: undefined | null | Node): boolean;
    hasChildNodes(): boolean;
    insertBefore<T>(node: T, child: undefined | null | Node): T;
    isEqualNode(otherNode: undefined | null | Node): boolean;
    prepend(...nodes: (string | Node)[]): this;
    removeChild<T>(child: T): T;
    replaceChild<T>(node: Node, child: T): T;
    replaceChildren(...nodes: (string | Node)[]): this;
}

Hierarchy (view full)

Properties

childElementCount: number
children: readonly Node[]

Element.children on MDN

firstChild: null | ChildNode

Node.firstChild on MDN

firstElementChild: null | Element
lastChild: null | ChildNode

Node.lastChild on MDN

lastElementChild: null | Element
nextSibling: null | ChildNode

Node.nextSibling on MDN

nodeName: string

Node.nodeName on MDN

nodeType: number

Node.nodeType on MDN

parentNode: null | ParentNode

Node.parentNode on MDN

previousSibling: null | ChildNode

Accessors

  • get nodeValue(): null | string
  • Returns null | string

    Node.nodeValue on MDN

  • set nodeValue(value): void
  • Parameters

    • value: null | string

    Returns void

  • get textContent(): null | string
  • Returns null | string

    Node.textContent on MDN

  • set textContent(value): void
  • Parameters

    • value: null | string

    Returns void

Methods

  • Parameters

    • Rest...nodes: (string | Node)[]

    Returns this

    Element.append on MDN

  • Parameters

    • Rest...nodes: (string | Node)[]

    Returns this

    Element.prepend on MDN