Check an element against a selector

// Return true if `ele` matches the CSS selector `selector`
const matches = function(ele, selector) {
return (
ele.matches ||
ele.matchesSelector ||
ele.msMatchesSelector ||
ele.mozMatchesSelector ||
ele.webkitMatchesSelector ||
ele.oMatchesSelector
).call(ele, selector);
};

More

Previous
Change the website favicon
Next
Check if an element has given class