title: Get all elements within using d3
body: <p>I am new to d3.js and am trying to get an array of all the elements in the selectAll and get the reaction-label label text, for each reaction element. Below is my html and my code to access the elements:</p>
  
  <pre><code>    HTML: 
     &lt;g id='reactions'&gt;
       &lt;g id='r0' class='reaction'&gt;
         &lt;g class='reaction-label-group' transform='translate(360,500)'&gt;
           &lt;text class='reaction-label label'&gt;HELLO&lt;/text&gt;
         &lt;g id='r1' class='reaction'&gt;
           &lt;g class='reaction-label-group' transform='translate(365,500)'&gt;
             &lt;text class='reaction-label label'&gt;HELLO2&lt;/text&gt;
  
  
  Javascript:
  var reactionsVar =d3.selectAll('#reactions').selectAll('.reaction').attr("transform").text;
  </code></pre>
  
  <p>However, I am unable to get all the reaction data.</p>
  
  <p>Thanks in advance for your help.</p>