Function query

  • Async iterator over DOM query strings

    query(`div`); // all DIVs
    query([`.class`, `.and-other-class`]); // All things with these two classes

    Parameters

    • queryOrElement:
          | string
          | HTMLElement
          | (string | HTMLElement)[]
          | AsyncGenerator<string | HTMLElement, any, unknown>
    • options: Partial<ElementQueryOptions> = {}

    Returns AsyncGenerator<HTMLElement>