W3School TIY Editor
W3School 在线教程
改变方向
暗黑模式
运行代码
<!DOCTYPE html> <html> <head> <script> function openWin() { var myWindow = window.open("", "", "width=400, height=200"); myWindow.opener.document.getElementById("demo").innerHTML = "已经打开一个新窗口。"; } </script> </head> <body> <button onclick="openWin()">打开 myWindow</button> <p id="demo"></p> </body> </html>