JavaScript Window Properties

You are Here:

JavaScript Window Properties

The following are the list of Window properties available in JavaScript programming.

FunctionsExplanation
closedIndicates whether the referenced window is closed or not.
documentReturns a reference to the document contained in the window.
frameElementReturns the frame (<iframe>, <object>, and <embed>) element in which the current window is inserted.
fullScreenIndicates whether the window is displayed in full screen mode or not.
innerHeightReturns the height (in pixels) of the browser window viewport including, the horizontal scrollbar, if rendered.
innerWidthReturns the width (in pixels) of the browser window viewport including, the vertical scrollbar, if rendered.
lengtheturns the number of frames (<iframe>, <embed>, and <object>) in the window.
localStorageAllows you to access and save data (key/value pairs) in a web browser.
location.hrefReturns the whole URL of the current page.
location.hostnameReturns the domain name of the web host.
location.pathnameReturns the path of the current page.
location.protocolReturns the web protocol used by the current page (http: or https:).
location.portReturns a string containing the port number of the current page.
openerReturns a reference to the window that opened the window using window.open().
outerHeightReturns the outer height (in pixel) of the browser window, including sidebar, window chrome, and window-resizing borders/handles.
outerWidthReturns the outer width (in pixel) of the browser window, including sidebar, window chrome, and window-resizing borders/handles.
pageXOffsetReturns the number of pixels that the document is currently scrolled horizontally.
pageYOffsetReturns the number of pixels that the document is currently scrolled vertically.
parentReturns a reference to the parent of the current window or subframe.
screen.widthReturns the width of the screen, in pixels.
screen.heightReturns the height of the screen, in pixels.
screen.availWidthReturns the amount of horizontal space (in pixels) available to the window.
screen.availHeightReturns the amount of vertical space (in pixels) available to the window.
screen.colorDepthReturns the color depth of the screen.
screen.pixelDepthReturns the bit depth of the screen.
scrollXReturns the number of pixels that the document is currently scrolled horizontally.
scrollYReturns the number of pixels that the document is currently scrolled vertically.
selfReturns the current window.
sessionStorageAllows you to access and save data (key/value pairs) in a web browser.
topReturns a reference to the topmost window in the window hierarchy.

Reminder

Hi Developers, we almost covered 97% of JavaScript Tutorials with examples for quick and easy learning.

We are working to cover every Single Concept in JavaScript.

Please do google search for:

Join Our Channel

Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.

This channel is primarily useful for Full Stack Web Developer.

Share this Page

Meet the Author