HTML DOM Element offsetParent Property
HTML DOM Element offsetParent Property
The offsetParent property is used to return the nearest ancestor which has a non-static position i.e, other than static. It will return null if the element is invisible. The default offset is document.body. It has all properties like offsetWidth, offsetHeight, offsetLeft, and offsetTop.
Syntax:-
Its syntax is:- element.offsetParent
Return:-
Its return is:- nearest positioned ancestor