How would I go about removing all of the child elements of a DOM node in JavaScript?
Say I have the following (ugly) HTML:
&
Other ways in jQuery
var foo = $("#foo"); foo.children().remove(); //or $("*", foo ).remove(); //or foo.html(""); //or foo.empty();