谁能帮我在 d3js 中完成这项工作
我的html标签如下
<div id="source1"><ul><li>Source</li></ul></div>
我想通过删除 DIV id source1 中的所有 UL LI 标签并在 div id source1 中创建新的 UL LI 标签来修改<li>Source</li>
with<li>some other text</li>
我的代码在这里
d3.selectAll("ul").remove()
d3.selectAll("li").remove()
var test=document.getElementbyId('source1');
var ul=document.createElement('ul');
document.body.appendChild(test);
test.appendChild(ul);
var li=document.createElement('li');
ul.appendChild(li);
li.innerHTML="some other text";