Skip to content

Instantly share code, notes, and snippets.

@hosseinzoda
Last active August 23, 2018 13:20
Show Gist options
  • Save hosseinzoda/c1910a6b5698e0173e4a1eb8ef40f9d0 to your computer and use it in GitHub Desktop.
Save hosseinzoda/c1910a6b5698e0173e4a1eb8ef40f9d0 to your computer and use it in GitHub Desktop.
IE dom issues & fixes
// There's an issue with IE, instead of Node having prototype contains,
// HTMLElement has it. Simple fix is to set the function for Node too
if (typeof Node != 'undefined' && typeof HTMLElement != 'undefined' &&
!Node.prototype.contains && HTMLElement.prototype.contains) {
Node.prototype.contains = HTMLElement.prototype.contains;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment