Function getElementsByTagType

  • getElementsByTagType(type: ElementType | ((type: ElementType) => boolean), nodes: AnyNode | AnyNode[], recurse?: boolean, limit?: number): AnyNode[]
  • Returns all nodes with the supplied type.

    Returns

    All nodes with the supplied type.

    Parameters

    • type: ElementType | ((type: ElementType) => boolean)

      Element type to look for.

    • nodes: AnyNode | AnyNode[]

      Nodes to search through.

    • recurse: boolean = true

      Also consider child nodes.

    • limit: number = Infinity

      Maximum number of nodes to return.

    Returns AnyNode[]