<html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>无标题文档</title> <script language="javascript" type="text/javascript"> window.onload=function(){ box.style.width="100px"; } </script> </head> <body> <div style="400px; height:400px; border:solid 1px orange" id="box"> </div> </body> </html>
ie里面从此不用 var box=document.getElementById("box")了,真是又爱又恨,之前我以为浏览器缓存了,折腾了大半天.
真是坑爹的玩意儿!