实例代码“Ctrl+/”提示“F11/ESC”全屏 返回 格式化 恢复 运行
x
 
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<script>
5
function createDoc()
6
  {
7
  var doc=document.open("text/html","replace");
8
  var txt="<!DOCTYPE html><html><body>Learning about the HTML DOM is fun!</body></html>";
9
  doc.write(txt);
10
  doc.close();
11
  }
12
</script>
13
</head>
14
15
<body>
16
<input type="button" value="New document" onclick="createDoc()">
17
</body>
18
</html> 
19