Created
December 6, 2011 21:38
-
-
Save jonalter/1440115 to your computer and use it in GitHub Desktop.
Remove all children function
This file contains hidden or 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 from a view | |
// Pedro :) | |
function removeChildren(el){ | |
var children = el.children; | |
while(el.children.length){ | |
var child = children[el.children.length-1]; | |
removeChildren(child); | |
el.remove(child); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment