Last active
October 1, 2016 19:28
-
-
Save englishextra/da26bf39bc90fd29435e8ae0b409ddc3 to your computer and use it in GitHub Desktop.
remove all children of parent element
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! | |
* 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