Usuń wszystkie dzieci Div
const parent = document.getElementById("foo")
while (parent.firstChild) {
parent.firstChild.remove()
}
Fine Falcon
const parent = document.getElementById("foo")
while (parent.firstChild) {
parent.firstChild.remove()
}