编辑下面的代码:【加编码】
<html> <head> <script> function createDoc() { var w=window.open(); w.document.open(); w.document.write("<h1>Hello World!</h1>"); w.document.close(); } </script> </head> <body> <input type="button" value="New document in a new window" onclick="createDoc()"> </body> </html>
结果: 【此窗口】 帮助?
Try it Yourself - © 自强学堂