title: jQuery applying height from data attribute
body: <p>I am trying to apply the height from the data attributes onto the divs, this only works for the first one as the second div gets the same height from the first element. Does anyone know of a way around this do I need to run it as an each function for example?</p>
  
  <p><a href="https://jsfiddle.net/y45rgsza/" rel="nofollow">https://jsfiddle.net/y45rgsza/</a></p>
  
  <pre><code>var $elements = {
     button: $('.js-show-more'),
     container: $('.js-readmore-container'),
     blockheight: $('.js-block-height')
  };
  
  
  var maxheight = $elements.container.height();
  var height = $elements.blockheight.data('height');
  
  if (maxheight &gt; 5) {
     $elements.blockheight.css("height", height);
  }
  </code></pre>