Reputation: 817
I have an HTML structure like this
body
svg
g
path d
circle (class=circles)
g
path d
circle (class=circles)
g
path d
g
path d
g
path d
circle (class=circles)
I want to remove all circles from body->svg->g->circle with class=circles . Some "g" tags have circles with class as "circles".
Please guide me how to do this.
Upvotes: 1
Views: 463
Reputation: 109232
You can do this in one line using a DOM selector:
d3.selectAll("circle.circles").remove();
Upvotes: 1