Created
December 10, 2019 03:48
-
-
Save jasondmoss/a9c5c25e2d53004fcbc4716b11af4bb2 to your computer and use it in GitHub Desktop.
Polyfill Methods for Internet Explorer 11 and below.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Polyfill for `Element.prototype.matches()` | |
* | |
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element/closest | |
*/ | |
if (!Element.prototype.matches) { | |
Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector; | |
} | |
/* <> */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment