Window Object in JavaScript
Rahul
Posted on November 25, 2020
The most important object in the Browser Object Model is the window object.
It helps in accessing information about the browser and its components. To access these features, it has various methods and properties.
(Please scroll a bit below I don't know why this is happening. Use the scroll bar plz.)
Property | Description |
---|---|
window.closed | Whether the window has been closed |
window.length | Number of <iframe> elements in the window |
window.name | Gets or sets the window name |
window.innerHeight | height of the window |
window.innerWidth | width of the window |
window.screenX | X-cordinate of the pointer, relative to the top left corner of screen |
window.screenY | Y-cordinate of the pointer, relative to the top left corner of screen |
window.location | current URL of window object |
window.history | Reference to history object for browser window or tab |
window.screen | Reference to object |
window.pageXoffset | Distance document has been scrolled horizantally |
window.pageYoffset | Distance document has been scrolled vertically |
window.alert() | creates dialog box with message OK button |
window.blur() | Remove focus from window |
window.close() | closes a browser window |
window.confirm() | Creates dialog box with message, and OK button and a **cancel **button |
window.getComputedStyle() | Get CSS styles applied to an element |
window.moveTo(x,y) | Move a window's left and top edge to supplied coordinates |
window.open() | Opens new browser window with URL specified as parameter |
window.print() | Tells browser that user wants to print contents of current page |
window.prompt() | Creates dialog box for retrieving user input |
windows.scrollBy() | Scroll the document by the specified number of pixels |
windows.scrollTo() | Scolls the document to the specified coordinates |
window.setInterval() | Do something repeatedly at specified intervals |
windows.setTimeOut() | Do something after a specified amount of time |
window.stop() | Stop window from loading |
Short and Informative Post for you all. 😀
âš¡Happy Coding
💖 💪 🙅 🚩
Rahul
Posted on November 25, 2020
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.