Before you can create dazzling data driven documents, you need to know how D3 accesses the DOM. This lesson will show you the ins and outs of accessing existing DOM elements with D3.

var div = d3.select('div');
console.log(div.nodes()); var divLinks = div.selectAll('a');
console.log(divLinks.nodes()); var secondLink = d3.selectAll('a:nth-child(2)');
console.log(secondLink.nodes()); var allLinks = d3.selectAll(document.links);
console.log(allLinks.size());
05-17 23:41