Javascript examples for Browser Object Model:Window open
Window open() Method - Replace the current window with a new window:
<!DOCTYPE html> <html> <body> <button onclick="myFunction()">Test</button> <script> function myFunction() {//from www. j a v a 2 s .c om var myWindow = window.open("", "_self"); myWindow.document.write("<p>I replaced the current window.</p>"); } </script> </body> </html>