The node that can be a child of another node.

Node on MDN

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

Hierarchy (view full)

Properties

firstChild: null | ChildNode

Node.firstChild on MDN

lastChild: null | ChildNode

Node.lastChild on MDN

nextElementSibling: 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

previousElementSibling: null | Element
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.after on MDN

  • Parameters

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

    Returns this

    Element.before on MDN