Window Close Function
Code to close a page or window on button click
: WindowMethod or Function
: close()Closing current window?
Closing the current page or window is very simple. Just calling close() or this.close() will close the window.Closing a newly opened window?
Closing the window that was created or opened by open method. For this we should use the reference that we obtain when the new browser window is created. The procedure is as follows
a) On opening a window, store the return object (window) in a variable
e.g: var xcv = open('url','name');
b) call close function or method on that window object
This example will close the window when a button click is done.
<input type=button onClick="closer()" value="click to close">