JavaScript Window Properties

Beginner
6 min read
Updated: Nov 2026
21 properties
Property index

About This Index

This page is the JavaScript Window Properties index for the tutorial track. Each row is a value you read on window. There is no separate tutorial file for these properties, so the description lives here.

Learn what the window is on /js/window. Functions such as alert() and setTimeout() are on the methods index.

No parentheses.

window.innerWidth is a number. window.closed is true or false. window.innerWidth() throws.

How to Read a Window Property

Properties are values. No parentheses:

JavaScript
window.self === window;     // true
window.closed;              // false while the tab is open
window.innerWidth;          // viewport width
window.scrollY;             // pixels scrolled down
window.location.href;       // full URL
window.localStorage;        // Storage for this origin

JavaScript Window Properties Table

Properties you read on window in this JavaScript tutorial (21 entries).

This window and its frames

8 properties

Read these on window to see which window you are in, and whether it sits inside a frame.

PropertyDescriptionGuide
selfThis window. window.self === window is true.On this page
nameThe window’s name string. It is "" unless the window or iframe was given a name.On this page
closedfalse while you can still use the window. true after that window has been closed.On this page
openerThe window that called open(), or null when the reader opened this tab.On this page
parentThe parent window. On a top-level page, parent === window.On this page
topThe topmost window. On a top-level page, top === window.On this page
lengthHow many child frames this window contains. A page with no iframes has length 0.On this page
frameElementThe iframe element that contains this window, or null on a top-level page.On this page

Size and scroll position

6 properties

Numbers, in CSS pixels. Read them with no parentheses.

PropertyDescriptionGuide
innerWidthWidth of the viewport, the area inside the window where the page is drawn.On this page
innerHeightHeight of the viewport, the area inside the window where the page is drawn.On this page
outerWidthWidth of the whole browser window, including the browser’s own bars.On this page
outerHeightHeight of the whole browser window, including the browser’s own bars.On this page
scrollXHow many pixels the document is scrolled horizontally. pageXOffset is the same value.On this page
scrollYHow many pixels the document is scrolled vertically. pageYOffset is the same value.On this page

The page this window shows

7 properties

Objects the window keeps for the document, the URL, history, and storage.

PropertyDescriptionGuide
documentThe page. window.document is the tree you search with querySelector and getElementById.On this page
locationThe URL of this window. location.href is the full address. Assigning it navigates the page.On this page
historyThe session history for this tab. history.back() goes to the previous entry.On this page
navigatorThe browser. navigator.userAgent is one string it exposes.On this page
screenThe display. screen.width and screen.height are the screen size in pixels.On this page
localStorageA Storage object for this origin that keeps keys after the tab closes.On this page
sessionStorageA Storage object for this origin that lasts until this tab closes.On this page

Frequently Asked Questions

Window properties are values on the window object. innerWidth and scrollY are numbers. closed is true or false. document, location, history, localStorage, and sessionStorage are objects. alert() and setTimeout() are methods, not properties.
The Window page teaches what the browser tab object is, with examples for self, location.href, and a timer id. This Properties index lists the values you read. Method tutorials are on the Window Methods index.
You read it with no parentheses: window.innerWidth. That number is the viewport width in CSS pixels. window.innerWidth() throws, because a number is not a function.
It is the number of child frames, such as iframes, in this window. A page with no frames has length 0. It is not the length of the URL or of localStorage.
If you are new, read JavaScript Window first. Then open the Window Methods index for alert(), setTimeout(), and open().

Call a method next

Properties are values. alert() and setTimeout() are functions.

Window Methods index →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

11 people found this page helpful