JSFiddle - React, Tailwind, and code Playground

HTML

<div id="dragger"></div>

CSS

#dragger{
    -webkit-user-drag: element;
    width: 100px;
    height: 100px;
    background: hsla(200, 100%, 50%, 0.4);
}

JavaScript

$('#dragger').bind('drag', function (e) {
    console.log(e.originalEvent.offsetX);
})