【发布时间】:2015-07-23 15:07:00
【问题描述】:
我正在使用 D3.js。这是我的标记:
<div class="graph-container">
<!--Graph SVG-->
</div>
<div class="graph-container">
<!--Graph SVG-->
</div>
<div>
<!--some other SVG-->
</div>
我正在使用以下 JS 来删除所有 SVG 元素:
d3.selectAll("svg > *").remove();
但我只想删除 graph-container 类中存在的 SVG。我该怎么做?
【问题讨论】:
-
作为旁注,您的类语法不正确,请删除
.。例如<div class="graph-container">. -
抱歉打错了
标签: javascript css d3.js svg