I want to remove all the childNodes from the javascript object. I referred W3Schools example. But they are using while loop and remove child node one by one. See the below code.
var list = document.getElementById("myList");
// As long as <ul> has a child node, remove it
while (list.hasChildNodes()) {
list.removeChild(list.firstChild);
}
I have more than 1000 childNodes. So i want to remove it in single steps. Using while loop will get performance issue. Any one help on this.
Thanks, Bharathi.