JSFiddle - React, Tailwind, and code Playground

HTML

<html>
    <head>
    </head>
    <body>
        <div id='test'>11</div>
    </body>
    </html>

CSS

#test{
    width: 100px;
    height: 100px;
    background-color: blue;
    margin-left: 20.8px;
    color: white;
    line-height: 100px;
    text-align: center;
    font-size: 14px;
    font-family: georgia;
}

JavaScript

var el = $('#test');
var offsetLeft = el[0].offsetLeft;
el.html(offsetLeft);