Window close() 方法
Window 对象
定义和用法
close() 方法用于关闭浏览器窗口。
语法
浏览器支持





所有主要浏览器都支持 close() 方法
实例
实例
下面的例子可关闭新的浏览器:
function openWin(){
myWindow=window.open("","","width=200,height=100");
myWindow.document.write("<p>这是'我的窗口'</p>");
}
function closeWin(){
myWindow.close();
}
尝试一下 »
Window 对象