运行结果尺寸: 300 x 150
x
 
<!DOCTYPE html>
<html>
<body>
<p>单击按钮创建一个窗口,然后显示新窗口的名称。</p>
<button onclick="myFunction()">试一试</button>
<script>
function myFunction() {
  var myWindow = window.open("", "MsgWindow", "width=200,height=100");
  myWindow.document.write("<p>This window's name is: " + myWindow.name + "</p>");
}
</script>
</body>
</html>
×

报个问题: