JSFiddle - React, Tailwind, and code Playground
HTML
<div id="a">
<div id="b"></div>
</div>
<p>hello</p>
CSS
#a {
width:100px; height:100px;
padding:10px; margin:20px;
background:rgba(200,200,200,1);
border:2px solid #eee;
position:relative;
}
#b {
width:60px; height:60px;
background:rgba(230,230,230,1);
}
JavaScript
$(function () {
var b = $('#b');
alert(b.position().top);
});