x
 
<!DOCTYPE html>
<html>
<body>
<h1>Document 对象</h1>
<h2>write() 方法</h2>
<h2>静夜思</h2>
<p>床前明月光,疑是地上霜。举头望明月,低头思故乡。</p>
<p>在加载文档后使用 document.write() 会删除所有现有的 HTML:</p>
<button type="button" onclick="myFunction()">点击我!</button>
<script>
function myFunction() {
  document.write("Hello World");
}
</script>
</body>
</html>