Ask coding questions

← Back to all posts
How to delete all childs of a parent in JavaScript?
RixTheTyrunt

The Googling would be a success, but none of codes worked. I want to delete all childs of a parent, it's id is named chatZipper, and I really want to delete all those bot's writings, how many I will make

Comments
hotnewtop
Coder100

just by doing remove all children get removed too because the parent is gone so the children don't have a place to go to.

RixTheTyrunt

;-; Then how to "create" the element to be again?

Coder100

do you just want to make the innerhtml nothing?

@SnackyPlusPlus

RixTheTyrunt

Maybe...

JustCoding123

This removes ALL of the children.