Skip to content

Instantly share code, notes, and snippets.

@quylaa
Created October 5, 2013 19:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save quylaa/6844952 to your computer and use it in GitHub Desktop.
Save quylaa/6844952 to your computer and use it in GitHub Desktop.
// Defines function
Element.prototype.remove = function() {
this.parentElement.removeChild(this);
}
NodeList.prototype.remove = HTMLCollection.prototype.remove = function() {
for(var i = 0, len = this.length; i < len; i++) {
if(this[i] && this[i].parentElement) {
this[i].parentElement.removeChild(this[i]);
}
}
}
// Now you just find the overlay things in the HTML
// and add something like
// document.getElementById("some-element-id").remove();
// or
// document.getElementsByClassName("some-class-name").remove();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment