Home
<!doctype html> <html> <head> <script src="https://d3js.org/d3.v4.min.js"></script> </head> <body> <p></p> <p></p> <p></p> <script> var data = [100, 200, 300]; var paragraph = d3.select("body") .selectAll("p") .data(data) .text(function (d, i) { console.log("d: " + d); console.log("i: " + i); console.log("this: " + this); return d; }); </script> </body> </html>
Result: