编辑下面的代码:【加编码】
<html> <body> <p id="demo"></p> <script> var w=window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; var h=window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight; x=document.getElementById("demo"); x.innerHTML="Browser inner window width: " + w + ", height: " + h + "." </script> </body> </html>
结果: 【此窗口】 帮助?
Try it Yourself - © 自强学堂