Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ParentNode

Hierarchy

Index

Properties

Readonly childElementCount

childElementCount: number

Readonly children

children: HTMLCollection

Returns the child elements.

Readonly firstElementChild

firstElementChild: Element | null

Returns the first child that is an element, and null otherwise.

Readonly lastElementChild

lastElementChild: Element | null

Returns the last child that is an element, and null otherwise.

Methods

append

  • append(...nodes: (string | Node)[]): void
  • Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes.

    Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.

    Parameters

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

    Returns void

prepend

  • prepend(...nodes: (string | Node)[]): void
  • Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes.

    Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.

    Parameters

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

    Returns void

querySelector

  • querySelector<K>(selectors: K): HTMLElementTagNameMap[K] | null
  • querySelector<K>(selectors: K): SVGElementTagNameMap[K] | null
  • querySelector<E>(selectors: string): E | null
  • Returns the first element that is a descendant of node that matches selectors.

    Type parameters

    Parameters

    • selectors: K

    Returns HTMLElementTagNameMap[K] | null

  • Type parameters

    Parameters

    • selectors: K

    Returns SVGElementTagNameMap[K] | null

  • Type parameters

    Parameters

    • selectors: string

    Returns E | null

querySelectorAll

  • querySelectorAll<K>(selectors: K): NodeListOf<HTMLElementTagNameMap[K]>
  • querySelectorAll<K>(selectors: K): NodeListOf<SVGElementTagNameMap[K]>
  • querySelectorAll<E>(selectors: string): NodeListOf<E>
  • Returns all element descendants of node that match selectors.

    Type parameters

    Parameters

    • selectors: K

    Returns NodeListOf<HTMLElementTagNameMap[K]>

  • Type parameters

    Parameters

    • selectors: K

    Returns NodeListOf<SVGElementTagNameMap[K]>

  • Type parameters

    Parameters

    • selectors: string

    Returns NodeListOf<E>

Generated using TypeDoc