Skip to main content

waitElement

Callable


  • Waits for the specified element to be present in the DOM and returns it.

    @throws

    If the promise is rejected due to the element not being found within the specified time.

    @example
    const fooElement = await waitElement({ selector: '.foo' })

    Type parameters

    • T: Element = Element

    Parameters

    Returns Promise<T>

    A promise that resolves with the found element.