title: Jquery addClass if image height greater than the width
body: <p>I have one question about jquery addClass image.</p>
  
  <p>I am trying this think in this <strong><a href="http://codepen.io/shadowman86/pen/VLyPOK" rel="nofollow">DEMO</a></strong> from codepen.io</p>
  
  <p>So the problem is the javascript is not adding class from the image if image height greater than the width. Anyone can help me in this regard ?</p>
  
  <p>This is my test jquery code: </p>
  
  <pre><code>$(document).ready(function() {
    var img = document.getElementById('.user_posted_image');
    //or however you get a handle to the IMG
    var width = img.clientWidth;
    var height = img.clientHeight;
  
    if(width &lt; height){
       $('img').addClass('portrait');
    }
  });
  </code></pre>