Rick Joe Rick Joe - 1 year ago 70
Javascript Question

get div height with the scroll? jquery

I need to get a div height, but this height must be the total height, with the scroll content.

for example:

var a = $('#rightinbox').height();

it will give me the div height but not the content inside height.


How can I get the div inside content height? with the scroll?
thank you friends!

Answer Source

You can use Element.scrollHeight to get the height including scroll content:

var a = $('#rightinbox')[0].scrollHeight;


var a = $('#rightinbox').prop('scrollHeight');