Javascript examples for Browser Object Model:Window open
Window open() Method - Open a new window called "MsgWindow", and write some text into it:
<!DOCTYPE html> <html> <body> <button onclick="myFunction()">Test</button> <script> function myFunction() {/*from w w w .jav a 2s.c om*/ var myWindow = window.open("", "MsgWindow", "width=200,height=100"); myWindow.document.write("<p>This is 'MsgWindow'. I am 200px wide and 100px tall!</p>"); } </script> </body> </html>