JSFiddle - React, Tailwind, and code Playground
HTML
<body>
<div id="screen" style="background-color: olive; height: 120px; width:120px;"></div> <span id="me" style="position: absolute; left: 44px; top: 86px;">me</span>
</div>
<p id="abc"> <span class="abc"></span>
</p>
</body>
JavaScript
var a = document.getElementById('screen')
var b = document.getElementById('me');
var c = document.getElementById('abc');
aOffsetLeft = a.offsetLeft;
aOffsetTop = a.offsetTop;
aoffsetHeight = a.offsetHeight;
aoffsetoffsetWidth = a.offsetoffsetWidth;
bOffsetLeft = b.offsetLeft;
bOffsetTop = b.offsetTop;
if ((aoffsetHeight + aOffsetTop >= bOffsetTop) || (aoffsetoffsetWidth + aOffsetLeft >= bOffsetLeft)) {
document.getElementById('abc').innerHTML = 'true';
} else {
document.getElementById('abc').innerHTML = 'false';
}