title: d3 equivalent of jQuery parent()
body: <p>I have various SVG <code>&lt;g&gt;</code> objects, each with a <code>&lt;circle&gt;</code> child and a <code>&lt;text&gt;</code> child. I can use <code>select()</code> to find a particular <code>&lt;text&gt;</code> object, by the class attached to it, and then modify it:</p>
  
  <pre><code>d3.select('text.my-class')
      .classed("my-class",false).classed("new-class",true)
      .text("Next Stage!")
      ;
  </code></pre>
  
  <p>Now I need to modify it's circle sibling. The circle has no particular identifying class (hhmmm... perhaps giving it one would be the d3 way of doing this?), so my first try was jQuery-like:</p>
  
  <pre><code>d3.select('text.my-class').parent().select('circle')
      .attr('style','fill:#f00;')
      ;
  </code></pre>
  
  <p>That fails with "parent is not a function".</p>
  
  <p>The answer to a similar question ( <a href="https://stackoverflow.com/q/20641953/841830">How to select parent element of current element in d3.js</a> ) suggested <code>this.parentNode</code>, but either I'm using it wrong or it does not work here. I've tried both of these:</p>
  
  <pre><code>d3.select('text.my-class').select(parentNode).select('circle')
  d3.select('text.my-class').select(this.parentNode).select('circle')
  </code></pre>