jQuery position() Method

jQuery HTML/CSS Methods : Return the top and left position of a <p> element

Definition and Usage

The position() method returns the position (relative to its parent element) of the first matched element.

This method returns an object with 2 properties; the top and left positions in pixels.

Syntax

$(selector).position()

Try it Yourself - Examples

Return the position of an element relative to its parent element
How to get the position of a <p> element inside a <div> element.