Javascript examples for Browser Object Model:Window open
Window open() Method - Use the opener property to return a reference to the window that created the new window:
<!DOCTYPE html> <html> <body> <button onclick="myFunction()">Test</button> <script> function myFunction() {/*from www. ja v a2s.c o m*/ var myWindow = window.open("", "myWindow", "width=200,height=100"); myWindow.document.write("<p>This is 'myWindow'</p>"); myWindow.opener.document.write("<p>This is the source window!</p>"); } </script> </body> </html>