English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
closedA read-only property indicating whether the referenced window is closed.
If the window is closed, this property returnstrue;If the window is already open, it returnsfalse.
window.closed
var x = document.getElementById("output"); function checkWindow() { if (!popupWindow) { x.innerHTML = "' popupWindow' Never opened!"; } else { if (popupWindow.closed) { x.innerHTML = "' popupWindow' Already closed!"; } else { x.innerHTML = "' popupWindow' Not closed!"; } } }Test See‹/›
All browsers fully support the close property:
Property | |||||
closed | Yes | Yes | Yes | Yes | Yes |
Return Value: | Boolean value, true if the window is closed; false if the window is open |
---|
Window (Window) Reference:window.opener property
Window (Window) Reference:window.open() method
Window (Window) Reference:window.close() method