Javascript examples for Browser Object Model:Window name
Window name Property - Set the name of the current window to "myWindowName":
<!DOCTYPE html> <html> <body> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {//from w ww. j a v a2 s . com window.name = "myWindowName"; var x = "This window's name is now: " + window.name; document.getElementById("demo").innerHTML = x; } </script> </body> </html>