delete all children of div code example
Example: delete all children of div
const parent = document.getElementById("foo")
while (parent.firstChild) {
parent.firstChild.remove()
}
const parent = document.getElementById("foo")
while (parent.firstChild) {
parent.firstChild.remove()
}