JSFiddle - React, Tailwind, and code Playground

by arjuncc

HTML

<div class="element" style="width:100px;height:70px;background-color: yellow;"> 21212</div> 

<div class="element" style="width:100px;height:90px;background-color: yellow;"> 21212</div>

 <div class="element" style="width:100px;height:78px;background-color: yellow;"> 21212</div>

JavaScript

(function( $ ){

  $.fn.maxHeight = function() {
  
    var max = 0;
    
    this.each(function() {
      max = Math.max( max, $(this).height() );
    });
      
          this.each(function() {
     if(max==$(this).height())
     {
         $(this).css({background:"red"});
     }
              
    });
      

    return max;
  };
})( jQuery );

var tallest = $('.element').maxHeight();