title: Setting an id issue in d3
body: <p>So this is what I'm doing: </p>
  
  <pre><code>selection = canvas.selectAll("circle").data(mydata)
  
              selection.enter().append("circle")
  
              selection
                  .attr("id", function(d, i){ var result = i+''; return result; })
  </code></pre>
  
  <p>In short, I'm trying to set the id of each element to be a string representation of its index. </p>
  
  <p>However, when I try to access that particular element later by using <code>d3.select("#1")</code> or by using a number variable i and going <code>d3.select("#" + i.toString())</code>, nothing seems to work. </p>
  
  <p>What am I doing wrong?</p>