close method (window)
Closes the current window.
The close method behaves differently in different browsers.
- In Opera, Google Chrome and Safari, it always closes the current window.
- In Internet Explorer, if the current window was opened by a script and it is not the last running instance of Internet Explorer, then the close method closes the window, else it displays a confirmation dialog.
- In Firefox, if the current window was opened by a script, the close method closes the window, else it does not.
You can find the related objects in the Supported by objects section below.
This method has no return value.
Example HTML code 1:
This example illustrates the use of the close method:
Did you find this example helpful?
User Contributed Comments