编辑下面的代码:【加编码】
<html> <head> <script> function createDoc()   {   var doc=document.open("text/html","replace");   var txt="<!DOCTYPE html><html><body>Learning about the HTML DOM is fun!</body></html>";   doc.write(txt);   doc.close();   } </script> </head> <body> <input type="button" value="New document" onclick="createDoc()"> </body> </html>
结果: 【此窗口】 帮助?
Try it Yourself - © 自强学堂