1// conventional method of selecting all paragraphs
2//and changing their color property to blue
3var paragraphs = document.getElementsByTagName("p");
4for (var i = 0; i < paragraphs.length; i++) {
5 var paragraph = paragraphs.item(i);
6 paragraph.style.setProperty("color", "blue", null);
7}
8//D3 way of doing the same
9d3.selectAll("p").style("color", "blue");