EN
Dieser Inhalt ist in Ihrer Sprache leider nicht verfügbar. Im Folgenden finden Sie die englische Version.

clientHeight property

Retrieves the height of the object including padding, but not including margin, border, or scroll bar.

Syntax

JavaScript

p = object.clientHeight

Property values

Type: Integer

the height of the object, in pixels.

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="console.log(oDiv.clientHeight)">client height</button>
<button onclick="console.log(oDiv.offsetHeight)">offset heightY</button>

See also

a
address
b
bdo
blockQuote
body
button
caption
cite
code
col
colGroup
custom
dd
dfn
div
dl
dt
em
embed
fieldSet
form
hn
html
i
img
input type=button
input type=checkbox
input type=email
input type=file
input type=image
input type=number
input type=password
input type=radio
input type=range
input type=reset
input type=search
input type=submit
input type=tel
input type=text
input type=url
kbd
label
legend
li
menu
meta
object
ol
option
p
pre
s
samp
script
select
small
span
strong
sub
sup
table
tBody
td
textArea
tFoot
th
tHead
tr
u
ul
var
Measuring Element Dimension and Location with CSSOM in Internet Explorer 9

 

 

Anzeigen:
© 2014 Microsoft. Alle Rechte vorbehalten.