DHTML Object Properties DHTML Objects
Retrieves the height of the object, in pixels, without taking into account any margin, border, scroll bar, or padding that might have been applied to the object.
HTML |
N/A |
Script |
[ iHeight = ] object.clientHeight |
iHeight |
Integer specifying the height of the object, in pixels. |
The property is read-only with no default value.
The following example demonstrates the difference between the clientWidth style attribute and the offsetWidth property in measuring the document width. Note The DIV's height is set to 100, and this is the value retrieved by the offsetHeight, not the clientHeight.
<div id=oDiv
STYLE="overflow:scroll; width:200; height:100">
. . . </div>
<button onclick="alert ( oDiv.clientHeight )">
client height</button>
<button onclick="alert ( oDiv.offsetHeight )">
offset height</button>
This feature requires Microsoft® Internet Explorer® 4.0 or later.
Show me
Measuring Element Dimension and Location, The Browser Screen