Skip to content

Instantly share code, notes, and snippets.

@englishextra
Last active October 1, 2016 19:28
Show Gist options
  • Save englishextra/da26bf39bc90fd29435e8ae0b409ddc3 to your computer and use it in GitHub Desktop.
Save englishextra/da26bf39bc90fd29435e8ae0b409ddc3 to your computer and use it in GitHub Desktop.
remove all children of parent element
/*!
* remove all children of parent element
* gist.github.com/englishextra/da26bf39bc90fd29435e8ae0b409ddc3
* @param {Object} e parent HTML Element
* removeChildren(e)
*/
var removeChildren=function(e){if(e&&e.firstChild)for(;e.firstChild;)e.removeChild(e.firstChild)};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment