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 links to a short property guide. Open a row to read syntax, examples, and FAQs.

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.Open
nameThe window’s name string.Open
closedtrue after the window has been closed.Open
openerThe window that called open(), or null.Open
parentThe parent window; equals window on top-level pages.Open
topThe topmost window in the frame tree.Open
lengthHow many child frames this window contains.Open
frameElementThe iframe element containing this window, or null.Open

Size and scroll position

6 properties

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

PropertyDescriptionGuide
innerWidthViewport width in CSS pixels.Open
innerHeightViewport height in CSS pixels.Open
outerWidthFull browser window width including chrome.Open
outerHeightFull browser window height including chrome.Open
scrollXHorizontal scroll offset in pixels.Open
scrollYVertical scroll offset in pixels.Open

The page this window shows

7 properties

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

PropertyDescriptionGuide
documentThe Document for this window.Open
locationThe Location object for this window’s URL.Open
historySession history for this tab.Open
navigatorThe Navigator object (browser info).Open
screenThe Screen object for the display.Open
localStorageOrigin storage that survives tab close.Open
sessionStorageOrigin storage that lasts for the tab session.Open

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 →

CODETOFUN NEWS

Stay Ahead in Tech

Get the latest IT news, programming updates, and technology trends directly on your phone.

Your daily dose of tech, straight to your feed.

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