I'm trying to detemine the height of a div in javascript. The actual height is defined in the attached stylesheet. When I query document.getElementById("ModuleHeader").style.height I get undefined. Here's a bit of the code:
The attached stylesheet contains this defintion:Code:<div id="ModuleHeader"> <img src="photobugHEAD.jpg" width="572" height="153"></div>
But this javascript returns undefined:Code:#ModuleHeader { width: 100%; height: 153px; position: relative; top: 0px; left: 0px; z-index: 20; text-align: left; background-color: #33CCCC; }
How can I get that to return 153? I don't want to rely on the height of the image, which in this case happens to be the same height as the div.Code:document.getElementById('ModuleHeader').style.height;
Thanks,
Nate Baxley







Bookmarks