Hosting Solutions
mobile_logo Table of Contents
seal_frontseal_back

Window

The Window object represents a browser window or tab. Its properties, methods and events provide a wide range of information and functionality revolving around the document container. Its 'document' property provides access to the entire document tree.

This syntax: alert("hello") document.getElementById("btn1") Is equivalent to this syntax because essentially everything stems from the window object: window.alert("hello") window.document.getElementById("btn1")

Properties

closed - determine whether or not a window is open. document - returns a reference to the Document object. frameElement - returns a reference to the iframe the document is embedded in. frames - returns an array referencing all iframe elements in the document. history - returns a reference to the History object. innerHeight innerWidth length location localStorage menubar messageManager name navigator opener outerHeight outerWidth pageXOffset pageYOffset sessionStorage parent performance screen screenX screenY sessionStorage scrollX scrollY self status top

Methods

addEventListener() alert() - render a dialog box with specified output. atob() blur() btoa() clearImmediate() clearInterval() clearTimeout() close() confirm() fetch() find() focus() getComputedStyle() getSelection() matchMedia() maximize() minimize() moveBy() moveTo() requestAnimationFrame() open() openDialog() postMessage() print() prompt() removeEventListener() resizeBy() resizeTo() scroll() scrollBy() scrollByLines() scrollTo() setCursor() setImmediate() setInterval() setTimeout() stop()

Events

abort beforeunload blur change click close contextmenu devicelight devicemotion deviceorientation deviceproximity error focus hashchange keydown keypress keyup languagechange load mousedown mousemove mouseout mouseover mouseup reset resize scroll select selectionchange submit unload

JavaScript

Objects

ArgumentsArrayAudioBooleanDataTransferDateDocumentElementFunctionGlobalHistoryHTMLElementMathNavigatorNumberObjectRegExpScreenStorageStringWindowXMLHttpRequest