JSFiddle - React, Tailwind, and code Playground
HTML
<div id="div"></div>
<br>
<button>Get the height and width of the div</button>
CSS
#div {
height: 200px;
width: 400px;
padding: 15px;
margin: 5px;
border: 2px solid #000;
background-color: grey;
color:#fff;
}
JavaScript
$(document).ready(function(){
$("button").click(function(){
var txt = "";
txt += "Width of div: " + $("#div").width() + "</br>";
txt += "Height of div: " + $("#div").height();
$("#div").html(txt);
});
});