Result Size: 625 x 534
x
 
<!DOCTYPE html>
<html>
<body>
<p id="demo">单击按钮用新内容替换此文档。</p>
<button onclick="myFunction()">试一试</button>
<script>
function myFunction() {
  document.open("text/html","replace");
  document.write("<h2>学习 HTML DOM 很有趣!</h2>");
  document.close();
}
</script>
</body>
</html>