offsetHeight property
The offsetHeight property contains
the full height of an element (includes
the element's actual width, border height,
padding, scrollbars):
Syntax
element.offsetHeight;
Example
Let's find out the full size of an element:
<div id="elem"></div>
#elem {
width: 100px;
height: 100px;
padding: 15px;
border: 10px solid black;
}
let elem = document.querySelector('#elem');
console.log(elem.offsetHeight);
The code execution result:
150
See also
-
the
clientHeightproperty
that contains the height of an element inside bordes -
the
offsetWidthproperty
that contains the full width of an element -
the
getComputedStylemethod
that obtains the value of an element's CSS property