Created
February 24, 2016 11:45
-
-
Save MattMS/2c1e30bfed0945f0e1e4 to your computer and use it in GitHub Desktop.
Remove all child nodes from a node on a web page.
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_child_nodes = (node)-> | |
while document.body.childNodes.length | |
document.body.removeChild document.body.childNodes[0] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment