Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

delete all children of div

const parent = document.getElementById("foo")
while (parent.firstChild) {
    parent.firstChild.remove()
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #delete #children #div
ADD COMMENT
Topic
Name
8+6 =