title: Get parentNode tagName
body: <p>I'cant get parentNode.tagName from this code and put some style to <code>li</code> tag. </p>
  
  <pre><code>// path to catalog images
  var img = $('.catalog ul li &gt; img');
  for (i = 0; i &lt; img.length; i++) {
      var pic_real_width;
      // Make in memory copy of image to avoid css issues
      $("&lt;img/&gt;").attr("src", $(img[i]).attr("src")).load(function () {
          pic_real_width = this.width;
  
          if (pic_real_width &gt; 500) {
              // this part of code not work
              var imageParent = this.parenNode.tagName = 'li';
              imageParent.style.width = '50%';
          }
      });
  }
  </code></pre>