JSFiddle - React, Tailwind, and code Playground

HTML

<div id="container" style="position:absolute; width: 100%; height: 200px;">
<div style="width: 2px; height: 100%; left: 20%; position:absolute; background-color: red; top: 0;"></div>
<div style="height: 2px; width: 100%; left: 0; position:absolute; background-color: blue; top: 25%;"></div>
</div>

JavaScript

var x = $('#container div:first').position().left;
var y = $('#container div:last').position().top;
console.log(x,y);