scrollHeight Property Sample

This sample demonstrates the use of the scrollHeight property to retrieve the height of the viewable content.

The scrollHeight property is read-only, allowing you to obtain the actual height of the scrollable content. Even though the height of this div is 200 pixels, the height inside the scrolling text box might be less, since the wrapped text may not use the entire area within the object. The scrollHeight dimension may be useful for a variety of reasons; for example, the height of the div could be set to the scrollHeight to conserve horizontal space while respecting the set width as a maximum.




[Right-click and choose View Source from the shortcut menu.]

© 2007 Microsoft Corporation. All rights reserved. Terms of use.