Create a New Window


Use the buttons below to test opening and closing windows in JavaScript.


Have fun!

 

  • Source

    <HTML>
    <HEAD><TITLE>Create a New Window</TITLE>
    </HEAD>
    <BODY>
    <H1>Create a New Window</H1>
    <HR>
    Use the buttons below to test opening and closing windows in JavaScript.
    <HR>
    <FORM NAME="winform">
    <INPUT TYPE="button" VALUE="Open New Window" 
    onClick="NewWin=window.open('','NewWin',
    'toolbar=no,status=no,width=200,height=100'); ">
    <P><INPUT TYPE="button" VALUE="Close New Window"
    onClick="NewWin.close();" >
    <P><INPUT TYPE="button" VALUE="Close Main Window"
    onClick="window.close();">
    </FORM>
    <BR>Have fun!
    <HR>
    </BODY>
    </HTML>