Motaz M. El Shazly
Motaz M. El Shazly

Reputation: 49

document.getElementById('').scrollHeight doesn't get the actual height

I have a div where it nest text, images that is changed more often and so the height of the div changes accordingly..

I need to get the height of div.

I have tried the jquery $("div#ID").height(); but it always returns a value smaller than the actual height, any help please?

Upvotes: 1

Views: 964

Answers (1)

Akhil Sekharan
Akhil Sekharan

Reputation: 12683

May be you should try,

$("#divID").outerHeight();
$("#divID").outerHeight(true); //includes margin of element

Upvotes: 1

Related Questions