JSFiddle - React, Tailwind, and code Playground
HTML
<div style="width:50%; display:inline-block">
<div class="a">
<div>
Some content here.
</div>
<div class="inserter">
insertme
</div>
</div>
<div class="b">
<div>
some other content
</div>
</div>
</div>
<div style="width:49%; display:inline-block">
<div class="a" style="z-index:1">
<div>
Some content here.
</div>
<div class="inserter">
insertme
</div>
</div>
<div class="b" style="z-index:2">
<div>
some other content
</div>
</div>
</div>
CSS
.a {
height:80%;
background: blue;
position:relative;
}
.b {
padding:30px;
background:green;
position:relative;
}
.inserter {
position:absolute; z-index:9999;
left:50%; margin-left:-20px;
background: red;
}
JavaScript
$('.inserter').each(function(){
var offset= $(this).offset();
var topEl = document.elementFromPoint(offset.left, offset.top);
console.log(topEl == this)
})