Function getElementById

  • 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

    The node with the supplied ID.