JSFiddle - React, Tailwind, and code Playground
HTML
<div class="test">
</div>
CSS
.test{
height: 100px;
}
JavaScript
const test = document.querySelector('.test');
test.addEventListener("mouseover", function(my) {
if(my.clientX < test.clientWidth/2){
alert('право, бл@@@')
}else{
alert('лево, бл@@@')
}
}, false);