js - remove all children
var rtbod = document.getElementById("tbod"); while (rtbod.childNodes.length) { rtbod.removeChild(rtbod.childNodes[0]); }