js删除所有子元素

没有removeAll的API,但也十分容易实现:

var lis = $("#yetai_tbody").find("tr");
$(lis).each(function () {
this.parentNode.removeChild(this);
});

while (node.hasChildNodes()) {
    node.removeChild(node.lastChild);
}    
原文地址:https://www.cnblogs.com/xiaoliu66007/p/4877109.html