In browsers, document.defaultView returns the window object associated with a document, or null if none is available.
var win = document.defaultView;
This property is read-only.
| Specification | Status | Comment |
|---|---|---|
| HTML Living Standard The definition of 'Document.defaultView' in that specification. | Living Standard | No change |
| HTML5 The definition of 'Document.defaultView' in that specification. | Recommendation | Initial definition |
| Feature | Firefox (Gecko) | Chrome | Edge | Internet Explorer | Edge | Opera | Safari |
|---|---|---|---|---|---|---|---|
| Basic support | (Yes) | (Yes) | (Yes) | 9.0 | 0.10 | (Yes) | (Yes) |
| Feature | Firefox Mobile (Gecko) | Android | Edge | IE Mobile | Opera Mobile | Safari Mobile |
|---|---|---|---|---|---|---|
| Basic support | ? | ? | ? | ? | ? | ? |
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/document/defaultView