ExampleGet the current position of a p element:
Try it yourself » |
The position() method returns the position of the first selected element, relative to the parent element.
This method returns an object with 2 properties, top and left, which represent the top and left positions in pixels.
$(selector).position() |
![]() |
Try it Yourself - Examples |
Get the position of an element inside another element
How to get the position of a p element inside a div element.