scrollHeight property is used to get the total height of the elements content, including the hidden contents due to scroll bar.
When the height is calculated it includes elements padding, but it does not include scroll bar size.
var elem = element.scrollHeight;
Example - Getting the scrollHeight of an element
- In the above example, when the button is clicked fun_name() function is called.
- Using the scrollHeight property, we are getting the height of the content present inside div element, and displaying it (alert (attr.ScrollHeight)).