Element.clientHeight is a read-only integer: the element’s inner height in CSS pixels. It includes padding and excludes borders, margins, and horizontal scrollbars (MDN).
Read the notes below before you get or set this property. Prefer feature detection when support is limited.
Syntax
Use el.clientHeight. Start with this line.
JavaScript
element.clientHeight
Call
What it does
element.clientHeight
Primary signature.
Built into the browser. Read or assign el.clientHeight — no import required.
Library declarations
JavaScript
element.clientHeight
Parameters
Parameter
Description
Compare property
Optional. offsetHeight / scrollHeight for other questions
Bottom line: Safe for production. Remember root-element reads return viewport height, and elements without a layout box return 0.
Frequently Asked Questions
A read-only integer: the element's inner height in CSS pixels, including padding but excluding borders, margins, and horizontal scrollbars (if present).
No. MDN marks Element.clientHeight as Baseline Widely available (since July 2015). It is not Deprecated, Experimental, or Non-standard.
No. It is read-only. Change layout with CSS (or element.style), then read clientHeight again.
MDN: roughly CSS height + CSS padding − height of a horizontal scrollbar if one is present. Elements with no CSS/inline layout boxes return 0.
On the root <html> element (or <body> in quirks mode), clientHeight returns the viewport height excluding any scrollbar.
offsetHeight is the border-box height (includes borders, and often scrollbars). scrollHeight is the full scrollable content height, which can be larger than the visible client area.