Exit not working properly
d3.js
Solution
Here's an updated fiddle with three changes: http://jsfiddle.net/URpfB/
1) your initial selectAll selector needs to be more specific as there are many descendant divs in the page after your code runs once. You need to distinguish between the top-most member divs and others by doing `selectAll('div.member')`
2) you need a data key function so d3 has more to go on than data length/position in order to determine when new data is added or old data is removed. In your example, this would keep each div.member associated with a single member name: `data(bandMates, function(d){return d.name;})`
3) as Snoozer pointed out, you need to be more precise when assigning selections to variables. You cannot exit() from enter() selections.
Problem
Hello Im quite new to D3 and Im having trouble with exit function I want to make some list and bars without using SVG and everything works like a charm. I select the div and then append and enter my data to populate variuos divs. ``` var content = d3.select("#graph").selectAll("div") .data(bandMates) .enter() .append("div") .classed("member",true) //Div contenedor content .append("div") .text(function(d) { return d.name; }); content .append("div") .style("height", "40px") .style("width", "0px") .style("background-color", "#ff9999") .transition() .duration(1000) .style("width", function (d){ return d.songs + "px";}); content .append("div") .text(function(d) { return "wrote " + d.songs + " songs!"; }); ``` at the end of the process I include the `content.exit().remove();` function because I want to be able to update the number of songs with another function and then calling de draw() function again. Firebug console is throwing me this error ``` content.exit is not a function ``` Am I missing something? I went to Bostock's tutorials and everything seems to be ok. I have done a JSFiddle to check out my code: http://jsfiddle.net/9HTUM/ Thanks for reading!