// Personal website of Chris Smith

Snippets » JavaScript » Remove all child elements

while (target.firstChild) {
    target.removeChild(target.lastChild)
}