SyntaxFix
Write A Post
Hire A Developer
Questions
If you want to get rid of all children,
svg.selectAll("*").remove();
will remove all content associated with the svg.