Skip to content

Instantly share code, notes, and snippets.

@charlesponti
Created November 9, 2014 15:15
Show Gist options
  • Save charlesponti/6918679298cacaaab0bc to your computer and use it in GitHub Desktop.
Save charlesponti/6918679298cacaaab0bc to your computer and use it in GitHub Desktop.
HTMLElement#empty polyfill
HTMLElement.prototype.empty = function() {
Array.prototype.slice.call(this.children).forEach(function(child) {
this.removeChild(child);
}.bind(this))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment