Window Object Properties Examples

Example 1: We will use the console property in this example to show how it works.

Javascript
// This is console property
console.log(window.location)

Output:

Location {ancestorOrigins: DOMStringList, href: 'chrome://new-tab-page/', origin: 'chrome://new-tab-page', protocol: 'chrome:', host: 'new-tab-page', …}

Window Object in JavaScript

In JavaScript, the Window object represents the window that contains a DOM document.

The Window object provides access to various properties and methods that enable interaction with the browser environment, including manipulating the document, handling events, managing timers, displaying dialog boxes, and more.

Similar Reads

Window Object Properties

The Window object in JavaScript has numerous properties that provide access to various aspects of the browser environment and the window itself. Some commonly used properties include:...

Window Object Properties Examples

Example 1: We will use the console property in this example to show how it works....

Window Object Methods:

A method in JavaScript is a function connected to an object. You may conduct operations or compute values by calling methods on objects....

Conclusion:

The window object in JavaScript represents the browser window or frame. It offers properties like innerHeight, innerWidth, screen, and methods like alert(), confirm(), open(), enabling interaction and control over the window and document....

Contact Us