• Test whether an element matches a CSS selector.

    Parameters

    • element: Element

      The element of interest.

    • selector: string

      The valid CSS selector of interest.

    Returns boolean

    true if the element is a match, false otherwise.

    Notes

    This function uses the builtin browser capabilities when possible, falling back onto a document query otherwise.