Document.defaultView

In browsers, document.defaultView returns the window object associated with a document, or null if none is available.

Syntax

var win = document.defaultView;

This property is read-only.

Specifications

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

Browser compatibility

DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
defaultViewChrome Full support 1Edge Full support 12Firefox Full support YesIE Full support 9Opera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes

Legend

Full support
Full support