Skip to content

Instantly share code, notes, and snippets.

View quylaa's full-sized avatar

Aleks Christensen quylaa

View GitHub Profile
// 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]);
}