I think I have a question that\'s pretty simple but I can\'t figure it out. My array is as follows:
var wordcount = [1, 2, 3, [{name: \'A\', values: [0,1,3,9
You need to select the non-existent elements as well for the selections to work properly. That is, your code should be
d3.select("#tooltippos").selectAll("div")
.data(d[3])
.enter()
.append("div")
.text(function(d) { return d.name; });
At the moment, the selection you're matching data against contains only the one element ("#tooltippos"), which is matched with the first element of the data. Hence, this is not in the enter selection and not drawn.