asp.net.ph

Skip Navigation Links

clientHeight Property

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.

Syntax


HTML N/A
Script [ iHeight = ] object.clientHeight

Possible Values


iHeight Integer specifying the height of the object, in pixels.

The property is read-only with no default value.

Example

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 

See Also

Measuring Element Dimension and Location, The Browser Screen



>

© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note