JSFiddle - React, Tailwind, and code Playground

HTML

<ul style="position: relative">
    <li>This is here just to take up space</li>
    <li id="target">Hello world</li>
</ul>

JavaScript

var pos = $("#target").position();
$("#target").text("This li is positioned " + pos.top + "px from the top and " + pos.left + "px from the left edge of the ul");