Here you can find the source of remove()
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]); } /* w ww . ja va 2 s. co m*/ } }
NodeList.prototype.remove = HTMLCollection.prototype.remove = function() { for(var i = this.length - 1; i >= 0; i--) { if(this[i] && this[i].parentElement) { this[i].parentElement.removeChild(this[i]); };