HTML DOM Element offsetTop
HTML DOM Element offsetTop Property
The offsetTop property is a read-only property and it returns the top position relative to the parent in pixels. The returned value contains:
- the top padding, scrollbar, and border of the parent
- the top position, and margin of the element
Syntax:-
Its syntax is:- element.offsetTop
Return:-
Its return is:- top position of an element in pixels