Is this window the topmost window:
if (window.top != window.self) {
text = "This window is NOT the topmost window!";
} else {
text = "This window is the topmost window!";
}
Try it Yourself »
The self
property returns the current window.
The self
property is read-only.
The self
property is often used in comparisons (see example above).
window.self
Type | Description |
An object | The Window object itself. |
window.self
is supported in all browsers:
Chrome | Edge | Firefox | Safari | Opera | IE |
Yes | Yes | Yes | Yes | Yes | Yes |
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!