/    /  Javascript Window

Javascript Window

 

The window object is known as a window in the browser. An object of the window is generated automatically by the browser.

The window is the object of the browser. It is not the object of javascript, and the javascript objects are string, array, date, etc.

 

Methods of window object:

 

  • alert()
  • confirm()
  • prompt()
  • open()
  • close()
  • setTimeout()

 

Example: 

 

alert()
<script type="text/javascript"> 
function msg(){ 
 alert("Hello Alert Box"); 
} 
</script> 
<input type="button" value="click" onclick="msg()"/>

 

OUTPUT:

 

Javascript Window