JSFiddle - React, Tailwind, and code Playground
by Anam Ansari
HTML
<div id="one">Foo one</div>
<div id="two">Foo two</div>
<br>
<div id="three">Foo three</div>
<div id="four">Foo four</div>
<br>
<div id="five">Foo five</div>
<div id="six">Foo six</div>
<div id="anam"> ansari</div>
CSS
div {
width: 50px;
height: 50px;
background-color: black;
color: white;
}
#anam
{
top:3px;
background:red;
position:absolute;
}
JavaScript
$(document).ready(function(){
$(document.body).bind('click', function(e){
var elem = document.elementFromPoint(e.pageX, e.pageY);
alert('you selected element id: ' + elem.id);
});
});