JavaScript/DOM: Remove All Children

By Xah Lee. Date: . Last updated: .

the best way to remove all children, is:

node.innerHTML = ""

const t = document.getElementById("abc");

// remove all children
t.innerHTML = "";
BUY Ξ£JS JavaScript in Depth