The example in this article tells you how to delete a child node created by JavaScript. Share to everyone for your reference. Specifically as follows:
JS created the node, temporarily do not know how to delete ... It took a whole lot of time.
for (var i = 0; i < jsonlist.length i++) {
var Li_button = document.createelement ("li");
Li_button.classname = "button";
var li_button_a = document.createelement ("a");
Li_button_a.id = jsonlist[i]._id;
var li_button_text = document.createTextNode (jsonlist[i].projectname);
Li_button_a.appendchild (li_button_text);
Li_button.appendchild (li_button_a);
Ul_level2.appendchild (Li_button);
}
Then I realized that the node is essentially
ul_level2.innerhtml = '; InnerHTML = ' content, as long as it is empty, you can clear the null node.
I hope this article will help you with your JavaScript programming.