Example 1 — Get Offset-Parent Coordinates
Official style: read { top, left } for an element.
var position = $("p").first().position();
console.log("left: " + position.left + ", top: " + position.top); How It Works
- Select. Target the first paragraph with
$("p").first(). - Read.
.position()returns a plain object withtopandleft. - Meaning. Those numbers are distances from the offset parent.

