matches

fun matches(selectors: String): Boolean(source)

Returns true if matching selectors against element's root yields element, and false otherwise.

MDN Reference