offsetHeight 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: javascript element height

var intElemOffsetHeight = element.offsetHeight;

Example 3: jquery offsetheight

//The offsetHeight property includes the vertical padding and borders in the height calculation, therefore
//the .outerHeight() method would be the jQuery equivalent to offsetheight.
$('.site-header').outerHeight();