title: d3 selection.attributes.key.nodevalue doesn't return the current DOM values
body: <p>Whenever I log the <code>selection.attributes</code> , it logs the values that are exactly required, for example if there's an attribute called <code>y</code> it would log the same value that the <code>rect</code> has in the DOM at the runtime, but whenever I try to access that value using <code>selection.attributes.y.nodeValue</code> it instead returns the original value of the <code>rect</code> that it was rendered with.</p>
  
  <p>My question is that if the actual attributes object has the current values then why does it return t he different value when I try to access the key (in this case <code>y.nodeValue</code>) in that object?</p>
  
  <p>For further explanation:</p>
  
  <p>Here's my code for logging object and code for logging the retrieval of  the value:</p>
  
  <pre><code>var notLiveYAttributes = chart.select("#not-live" + i + " rect.not-live")[0][0].attributes;
                console.log(notLiveYAttributes);
                console.log(notLiveYAttributes.y.value);
  </code></pre>
  
  <p><strong>Output:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/yRyIw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yRyIw.png" alt="enter image description here"></a></p>
  
  <p>What am I missing here and how can I retrieve the current values of the attributes (y and height) instead of when it was originally rendered/populated?</p>