Window close () method
Definition and Usage
close () method is used to close the browser window.
grammar
window.close()
Browser Support
All major browsers support close () method
Examples
Examples
The following example can close the new browser:
function openWin(){
myWindow=window.open("","","width=200,height=100");
myWindow.document.write("<p>这是'我的窗口'</p>");
}
function closeWin(){
myWindow.close();
}
myWindow=window.open("","","width=200,height=100");
myWindow.document.write("<p>这是'我的窗口'</p>");
}
function closeWin(){
myWindow.close();
}
try it"
Window object