JSFiddle - React, Tailwind, and code Playground

by mofle

HTML

<span id="test"></span>

CSS

#test {
    margin-right: -1px;
}

JavaScript

var rect = $('#test')[0].getBoundingClientRect();
console.log('rect:', rect.top, rect.left);
console.log('jq:', $('#test').offset().top, $('#test').offset().left );