In my code, I fairly frequently need to replace all children of a certain HTML container with a new list of children.
What is the fastest way to do this? My current appr
If you simply want to replace all children, regarding of the type, why don't you just set its content to '' and then add your code:
container.innerHTML = ''; container.appendChild( newContainerElements );
that would basically remove all the children in the fastest possible way :)