<!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 οnlοad="aa();"> <div id="userBlog">Content for New Div<br /><br /> Tag Goes Here</div> </body> </html>
转载于:https://www.cnblogs.com/hongjiumu/archive/2012/09/12/2681280.html