title: Get attribute x for axis' text element
body: <p>I created an XAXIS using d3.axisBottom(). Now I need to store the positions (x and y attributes of the tick text) in a separate variable.</p>
  <p>My full code is at codepen
  <a href="https://codepen.io/zubair57/pen/gOLeeOm" rel="nofollow noreferrer">https://codepen.io/zubair57/pen/gOLeeOm</a></p>
  <p>When I use below code to get &quot;x and y&quot; attributes, I get value for y attr but null for x attr. Could you tell me why I get null for x attr and how to get correct value</p>
  <pre><code>d3.select(&quot;.xaxis&quot;).selectAll(&quot;.tick text&quot;).each(function(d,i){
      let me=d3.select(this)  
      console.log(me.attr(&quot;x&quot;))
      console.log(me.attr(&quot;y&quot;))
  })
  </code></pre>