199 of 264 menu

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 clientHeight property
    that contains the height of an element inside bordes
  • the offsetWidth property
    that contains the full width of an element
  • the getComputedStyle method
    that obtains the value of an element's CSS property
iduzuzcplro