This page is Almost Ready

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

defaultView

Summary

Returns the Document’s browsing context’s Window object (essentially the environment in which objects are presented to the user) if there is one, or null otherwise.

Property of dom/Documentdom/Document

Syntax

var Window = document.defaultView;
document.defaultView = value;

Return Value

Returns an object of type ObjectObject

Returns the Window object of the active document

Examples

//displays the document's browsing context
function showDefView() {
    alert(document.defaultView);
}

Related specifications

HTML5 Specification
Working Draft

See also

Related pages

Attributions