This page is In Progress

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.


Property of dom/HTMLElementdom/HTMLElement


var result = element.scrollHeight;
element.scrollHeight = value;


This example uses the scrollHeight property to retrieve the height of the viewable content.

<script type="text/javascript">
function fnCheckScroll(){
    var iNewHeight = oDiv.scrollHeight;
    alert("The value of the scrollHeight property is: "
        + iNewHeight + "px");
<div id="oDiv" style="overflow: scroll; height= 100px; width= 250px; text-align: left">
<button onclick="fnCheckScroll()">Check scrollHeight</button>

View live example



The height is the distance between the top and bottom edges of the object’s content. This property is read-only on HTML documents, and read-write on fixed regions. For more information about how to access the dimension and location of objects on the page through the Dynamic HTML (DHTML) Object Model, see Measuring Element Dimension and Location with CSSOM in Internet Explorer 9.