JSFiddle - React, Tailwind, and code Playground

by Ishan Khare

HTML

<div id = "test">
    testing
</div>

CSS

#test {
    position : absolute;
    left : 50px;
    top : 50px;
    border-style : solid;
    border-radius : 3px;
    border-width : 2px;
}

JavaScript

var t = document.getElementById("test");
rect = t.getBoundingClientRect();
console.log(rect.left);