Retrieves the height of the object without taking into account any margin, border, scroll bar, or padding that might have been applied to the object.
Syntax
HTML N/A Scripting [ iHeight = ] object.clientHeight
Possible Values
iHeight Integer that specifies the height of the object, in pixels. The property is read-only with no default value.
Example
This example shows how the clientHeight property and the offsetHeight property measure document height differently.
Note The height of the DIV is set to 100, and this is the value retrieved by the offsetHeight property, not the clientHeight property.
Sample Code
<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 heightY</BUTTON>
Applies To
A, ADDRESS, APPLET, B, BDO, BIG, BLOCKQUOTE, BODY, BUTTON, CAPTION, CENTER, CITE, CODE, COL, COLGROUP, custom, DD, DFN, DIR, DIV, DL, DT, EM, EMBED, FIELDSET, FORM, HEAD, Hn, HTML, I, IMG, INPUT type=button, INPUT type=checkbox, INPUT type=file, INPUT type=image, INPUT type=password, INPUT type=radio, INPUT type=reset, INPUT type=submit, INPUT type=text, ISINDEX, KBD, LABEL, LEGEND, LI, LISTING, MARQUEE, MENU, META, NOBR, OBJECT, OL, OPTION, P, PLAINTEXT, PRE, S, SAMP, SCRIPT, SELECT, SMALL, SPAN, STRIKE, STRONG, SUB, SUP, TABLE, TBODY, TD, TEXTAREA, TFOOT, TH, THEAD, TR, TT, U, UL, VAR, XMP
See Also