title: Getting attribute of a parent node
body: <p>I am trying to use </p>
  
  <pre><code>$(this).parentNode.attr('data-element')
  </code></pre>
  
  <p>which should return 0 - 5 in string but it just won't work. I am using it in a function like this</p>
  
  <pre><code>$('.someClass').each(function(){
      $(this).html(SomeFunction('SomeString', $(this).parentNode.attr('data-element')));
  });
  </code></pre>
  
  <p>All the elements with class 'someClass' have a parentNode</p>
  
  <pre><code>&lt;li class="element" data-element: 1 (or any number from 0 to 5 (including))&gt; &lt;/li&gt;
  </code></pre>
  
  <p>and I have no idea where is the mistake. What am I doing wrong?</p>
  
  <p>--David</p>