代码改变世界

javascript获取的层(div)高度

2012-09-12 10:21  hongjiumu  阅读(413)  评论(0编辑  收藏  举报
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>Untitled Document</title>
<script type="text/javascript">
function aa(){
alert(document.getElementById("userBlog").offsetHeight+"px");
}
</script>
</head>
<body onload="aa();">
<div id="userBlog">Content for New Div<br /><br /> Tag Goes Here</div>
</body>
</html>