javascript offset code example
Example 1: offsetheight javascript
// The HTMLElement.offsetHeight read-only property returns the height
// of an element, including vertical padding and borders, as an integer.
let intElemOffsetHeight = element.offsetHeight;
Example 2: offset in js
var d = document.getElementById("div1");
var topPos = d.offsetTop;
if (topPos > 10) {
// object is offset more
// than 10 pixels from its parent
}