Is there any way to test if a selector would match a given DOM Element? Preferably, without the use of an external library like Sizzle. This is for a library and I would li
For the benefit of those visiting this page after lo these many years, this functionality is now implemented in all modern browsers as element.matches
without vendor prefix (except for ms
for MS browsers other than Edge 15, and webkit
for Android/KitKat). See http://caniuse.com/matchesselector.