Note: please check the offsetParent property if you’re not familiar with it.
The offsetTop property is read-only and so we can’t assign a value to it.
The distance between the top inner border of the offsetParent node (the <ol> element in this example) and the outer top border includes the top padding of the offsetParent node and the top margin of the current element.
So if we combine these two values, we should get the result distance for this particular example:
21px + 21px = 42px;
But remember, in other scenarios, there might be other nodes between these two elements which will affect the final distance.