I'm trying to append two span
s to a div
using the following code:
d3.select("#breadcrumb")
.append("span")
.attr("class","breadcrumb-link")
.text(d.name)
.append("span")
.text("/");
But this adds elements like:
<div id="breadcrumb">
<span>
<span>
</span>
</span>
</div>
I want to add span
s as siblings:
<div id="breadcrumb">
<span>
</span>
<span>
</span>
</div>
I know this can be done by first selecting the div
and then using 2 statements for each span
. Can I do this in a single chained statement?