Javascript examples for Browser Object Model:Window opener
The opener property returns a reference to the window that created the window.
A reference to the window that created the window
Write some text to the source (parent) window:
<!DOCTYPE html> <html> <body> <button onclick="myFunction()">Test</button> <script> function myFunction() {/*from w w w . j a va2 s.co 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>