JSFiddle - React, Tailwind, and code Playground
HTML
<div id="demo" style="height: 50px;">
hi
</div>
<button onclick="show_height()">Show Height</button>
<button onclick="height_100()">Set 100px</button>
<button onclick="height_20()">Set 20px</button>
CSS
#demo{
overflow:hidden;
border:1px solid #000;
}
JavaScript
function show_height()
{
var h = document.getElementById("demo").style.height;
alert(h);
}
function height_100()
{
document.getElementById("demo").style.height="100px";
}
function height_20()
{
document.getElementById("demo").style.height="20px";
}