Property of dom/HTMLElementdom/HTMLElement
Syntaxvar result = element.scrollHeight;
element.scrollHeight = value;
Examples
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");
}
</script>
...
<div id="oDiv" style="overflow: scroll; height= 100px; width= 250px; text-align: left">
...
</div>
<button onclick="fnCheckScroll()">Check scrollHeight</button>
Notes Remarks
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.
Syntax AttributionsMicrosoft Developer Network: [Windows Internet Explorer API reference Article]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4