Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

clientHeight

Property of dom/HTMLElementdom/HTMLElement

Syntax

var result = element.clientHeight;
element.clientHeight = value;

Examples

This example shows how the clientHeight property and the offsetHeight property measure document height differently. The height of the div is set to 100, and this is the value retrieved by the offsetHeight property, not the clientHeight property.

<div id="oDiv" style="overflow: scroll; width: 200px; height: 100px">
    . . . </div>
<button onclick="alert(oDiv.clientHeight)">client height</button>
<button onclick="alert(oDiv.offsetHeight)">offset heightY</button>

View live example

Syntax

Attributions