Function getElementById

  • getElementById(id: string | ((id: string) => boolean), nodes: AnyNode | AnyNode[], recurse?: boolean): Element | null
  • Returns the node with the supplied ID.

    Returns

    The node with the supplied ID.

    Parameters

    • id: string | ((id: string) => boolean)

      The unique ID attribute value to look for.

    • nodes: AnyNode | AnyNode[]

      Nodes to search through.

    • recurse: boolean = true

      Also consider child nodes.

    Returns Element | null