JSFiddle - React, Tailwind, and code Playground

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>

CSS

div {
    width: 50px;
    height: 50px;
    background-color: black;
    color: white;
}

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);
    });
});