/ Published in: JavaScript
This while loop will remove all childNodes from a selected element.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
var holder = document.getElementById("whateverDiv");//the holder div while(holder.hasChildNodes()){ holder.removeChild(holder.lastChild); }