elementclientHeight
element.clientHeight is a read-only property of the Element interface in the Document Object Model (DOM). It returns the inner height of the element in pixels, including the element’s padding but excluding the element’s border, margins, and any horizontal scrollbar space. In short, it measures the height of the element’s content area plus its padding.
The value is expressed as a number in CSS pixels and can change as the element’s size
A common use is to determine whether the element’s content overflows its visible area. If element.scrollHeight
- If the element is not rendered (for example, display is none or it is not attached to
- The value can be affected by CSS box-sizing rules, padding, and the element’s current display and
- It does not include borders or scrollbars, even when those features affect the visible size.
Example usage: retrieving the height of a container in a script would typically be done with a