Closes the current window, or the window on which it was called.
When this method is called, the referenced
window is closed.
This method is only allowed to be called for windows that were opened by a script using the
Scripts may not close windows that were not opened by script.
Closing a window opened with
This example demonstrates how to use this method to close a window opened by script calling
Closing the current window
When you call the
close() method directly, rather than calling
close() on a
window instance, the browser will close the frontmost window, whether your script created that window or not. (Firefox 35.0.1: scripts can not close windows, they had not opened)
|WHATWG HTML Living Standard
The definition of 'window.close()' in that specification.