JSFiddle - React, Tailwind, and code Playground
HTML
<div id='div1'> </div>
CSS
#div1{
height: auto;
}
JavaScript
//Javascript in Document Load event
var div1 = document.getElementById('div1');
var child1 = document.createElement('div');
child1.setAttribute('style', 'height:50px');
div1.appendChild(child1);
var height = $("#div1").height();
alert(height);//value of height is 10px NOT 50px