Hi Everyone. I need to be able to capture the height of a div. i am enclosing my code. this is a simplified version of what i want to do. i have tried debuggin this using firebug. It seems that the "height" in the statement boxInFunction.style.height shows as undefined. Any help will be greatly appreciated.
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
.box{
height:100px;
background-color:green;
}
</style>
</head>
<body>
<div id="mybox" class="box" onClick="checkHeight('mybox');">
<h1> This is my box</h1>
</div>
<script type="text/javascript">
function checkHeight(boxname)
{
var boxInFunction =document.getElementById(boxname);
var boxHeight = boxInFunction.style.height;
alert(boxHeight);
}
</script>
</body>
</html>



