Skip to content

Instantly share code, notes, and snippets.

@elijahmanor
Last active November 1, 2018 08:07
Show Gist options
  • Save elijahmanor/6452535 to your computer and use it in GitHub Desktop.
Save elijahmanor/6452535 to your computer and use it in GitHub Desktop.
Element matches Polyfill
if (Element && !Element.prototype.matches) {
var proto = Element.prototype;
proto.matches = proto.matchesSelector ||
proto.mozMatchesSelector || proto.msMatchesSelector ||
proto.oMatchesSelector || proto.webkitMatchesSelector;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment