Loading

Window Object

  • In JavaScript, the window object represents the web browser's window or tab in which the JavaScript code is running.
  • It serves as the entry point to various features and properties related to the browser window. 

Properties:

window.document:

  •  Provides access to the current web page's Document Object Model (DOM).

window.location:

  •  Represents the current URL of the web page and allows you to access and modify various parts of the URL, such as the hostname, pathname, and query parameters.

window.navigator:

  •  Contains information about the user's browser, including its name, version, and platform.

window.history:

  •  Provides access to the browser's navigation history, allowing you to move forward or backward in the user's browsing history.

Methods of Window Object: