Prototype This page is part of the Prototype JavaScript framework documentation.
Overview | (...)

Element.getHeight is used for getting the height of an element.

Syntax


  Element.getHeight( element );

element can be any DOM Element object or an ID.

Example 1


<div id="high_element" style="background-color: #efe; height: 60px">
This element is so high ...
that you may want to check its height.
It should be 60px high, by the way.
</div>

<p>
<a href="#" onclick="alert(Element.getHeight('high_element') + ' pixels'); return false">Check
height in pixels</a>
</p>

creates:

This element is so high …
that you may want to check it’s height.

Check height

Notes

Inner and outer width

The method returns the inner height of the element.

If you want the outer version of this method you should consider adding the browser-computed value of border-top-width and border-bottom-width of the element, using the Element.getStyle method.