More information about the Underscore mailing list

[_] detect height of div

rick hurst rickhurst at linuxmail.org
Thu Oct 9 14:33:54 BST 2003

having problems detecting the height of a div with javascript.

if I have a div like

<div id="mydiv" style="width:100px;height:100px">
</div>

and I do:-

body onload="alert(document.getElementById("mydiv").style.height)"

it returns 100px even if I fill the div with a whole page of text. If I remove the style it returns blank.

I won't know how much content is in the div because it is dynamically generated.

(This only needs to work on IE 5.5+ for an intranet app, but mozilla support would be good)

any ideas?


Rick Hurst
Web Developer
blog: http://hypothecate.co.uk