title: D3 Getting Name Of Parent Node
body: <p>I have a node-link diagram drawn in D3 via a JSON document.  Example below.</p>
  
  <p><img src="https://i.stack.imgur.com/2KItz.png" alt="enter image description here"></p>
  
  <p>What I want to do is get the parent node's name when a child is clicked on.  For example, if I click on "Red", I want "Color" to get returned.</p>
  
  <p>All the things I've tried using .parent have been failures.  In my debugging so far, I've tried this, this.parent and this.parent.parent... but none of them give me what I'm looking for, nor can I see how I could get this data.</p>
  
  <p>I can post the code or data or whatever you guys need, but I'm guessing I'm missing something small and trivial and hoping you can help.</p>