Find Scroll Height for elements using jQuery
One need to use scrollHeight property to get height of the scroll view of an element.
If you are using jQuery 1.7 or higher version then use prop(), otherwise use attr(). In the code sample, I have used "prop()" to get value of "scrollHeight" property.
$(document).ready(function() { //Get height of the div var iHeight = $("#dvContent").height(); //Get ScrollHeight of the div var iScrollHeight = $("#dvContent").prop("scrollHeight"); var msg = 'Height:' + iHeight + 'px & ScrollHeight:' + iScrollHeight + 'px'; $("span").html(msg); });?
See result below.
Feel free to contact me for any help related to jQuery, I will gladly help you.