The window object is a global object that has the properties pertaining to the
current DOM document, which is what's in the tab of a browser. The document
property of the window object has the DOM document and associated nodes and
methods that we can use to manipulate the DOM nodes and listen to events for
each node.
(Original Answer by Quaint Quelea, I just added linebreaks to make it readable)
/*
The window object represents a window in browser.
An object of window is created automatically by the browser.
Window is the object of browser, it is not the object of javascript.
*/
<script type="text/javascript">
function msg(){
alert("Hello Alert Box");
}
</script>
<input type="button" value="click" onclick="msg()"/>
window //Any property of this is avalable globaly
window.setInterval===setInterval//true
var woke = "Woke, Man";
woke===window.woke//true
window.woke = "no mo woke";
woke===window.woke//still true