Waits the provided milliseconds for elements to appear or returns null. Supports callbacks and promises.

  • Parameters

    • selector: string

      Selector to pass to document.querySelector()

    • timeout: number = 5000

      Max time to wait, in millis

    • cb: (() => undefined | void)

      Callback to execute after the element is found. Argument is the found element

        • (): undefined | void
        • Returns undefined | void

    Returns Promise<undefined | void> | Promise<null | NodeListOf<Element>>

Index

Documents