.offsetParent()
methodThe .offsetParent()
method in jQuery is used to get the closest ancestor element that is positioned.
.offsetParent()
method Syntax.offsetParent()
.offsetParent()
method ExampleFind the offsetParent of paragraph and highlight it.
Don't forget to set the element position attribute to absolute
, relative
or fixed
.