Javascript examples for Browser Object Model:Window open
Window open() Method - Open a new window. Use the name property to return the name of the new window:
<!DOCTYPE html> <html> <body> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {/*from w w w . jav a2s.c o m*/ window.name = "myWindowName"; var x = "This window's name is now: " + window.name; document.getElementById("demo").innerHTML = x; } </script> </body> </html>