JSFiddle - React, Tailwind, and code Playground

HTML

<div class="div1 box"></div>
<div class="div2 box"></div>

CSS

.div1{
    
    background-color:#ff0000;
    height:200px;
    width:200px;
}

.div2{
    
    background-color:#00ff00;
    height:100px;
    width:200px;
}

JavaScript

$(function(){

    var maxHeight = 0;
    $('.box').each(function() {
        if($(this).outerHeight()>maxHeight) maxHeight=$(this).outerHeight();
    });
    
    $('.box').each(function() {
      $(this).css('height', maxHeight+'px');
    });
    
});