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

