Window closed property
- Previous Page close()
- Next Page confirm()
- Go to the Previous Level Window Object
Definition and usage
If the window is closed, then closed
The property returns true
.
closed
The property is read-only.
See also:
Example
Function to check if the window is closed:
function checkWin() { if (!myWindow) { text = "It has never been opened!"; } else { if (myWindow.closed) { text = "It is closed."; } else { text = "It is open."; } } }
Syntax
window.closed
Return value
Type | Description |
---|---|
Boolean Value | If the window is closed, it is true; otherwise, it is false. |
Browser Support
All Browsers Support window.closed
:
Chrome | IE | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
Chrome | IE | Edge | Firefox | Safari | Opera |
Support | Support | Support | Support | Support | Support |
- Previous Page close()
- Next Page confirm()
- Go to the Previous Level Window Object