JSFiddle - React, Tailwind, and code Playground
HTML
<html>
<body>
<div id="mainDiv" class="main">test1</div>
<div id="secondDiv" class="second">test2</div>
<br>
<input type="button" id="button1" value="change"/>
<br>
</body>
</html>
CSS
.dialog { display:none; }
.main { background-color: blue; }
.second { background-color:red;}
JavaScript
$(document).ready(function() {
$("#mainDiv").bind("divResized", function(){
var height = $(this).height();
$("#secondDiv").height(height);
});
$("#button1").on("click", function() {
$("#mainDiv").html("New text added<br>New text added<br>New text added<br>");
$("#mainDiv").trigger("divResized");
});
});