JSFiddle - React, Tailwind, and code Playground

HTML

<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.11/themes/base/jquery-ui.css">
<div id='mydiv'></div>

CSS

#mydiv{margin:50px;width:200px;height:200px;background:#000}

JavaScript

$('#mydiv').on('click',function(e){
      console.log(e.clientX - $(this).offset().left);    
});