HTML | DOM Window opener Properties Last Updated : 10 Sep, 2024 Comments Improve Suggest changes Like Article Like Report The Window opener property in HTML DOM is used to return the reference of newly created windows. This property is used to return the details of the source (parent) window. A window is opened using the window.open() method and closed using the window.opener.close() method. Syntax:window.openerReturn Value: It returns the reference of the created window. Example 1: This example shows the single window opening on clicking the button. HTML <!DOCTYPE html> <html> <head> <title> HTML DOM Window opener Property </title> </head> <body> <h2> HTML DOM Window opener Property </h2> <button onclick="myGeeks()"> Click Here! </button> <!-- script to open new windows --> <script> function myGeeks() { let win = window.open("", "win", "width = 500, height = 300"); win.document.write("<p>New Window</p>"); win.opener.document.write("<p>Parent Window</p>"); } </script> </body> </html> Output: Example 2: This Example shows the double window creation on clicking the single button. HTML <!DOCTYPE html> <html> <head> <title> HTML DOM Window opener Property </title> </head> <body> <h2> HTML DOM Window opener Property </h2> <button onclick="myGeeks()"> Click Here! </button> <!-- script to create two window --> <script> function myGeeks() { let win1 = window.open("", "win1", "width = 500, height = 300"); let win2 = window.open("", "win2", "width = 400, height = 250"); win1.document.write("<p>New Window 1</p>"); win2.document.write("<p>New Window 2</p>"); win1.opener.document.write("<p>Parent Window</p>"); win2.opener.document.write("<p>Parent Window</p>"); } </script> </body> </html> Output: Supported BrowsersGoogle Chrome 1 and aboveEdge 12 and aboveInternet Explorer 9 and aboveFirefox 1 and aboveOpera 3 and aboveSafari 1 and above Create Quiz Comment R riarawal99 Follow 0 Improve R riarawal99 Follow 0 Improve Article Tags : Web Technologies HTML HTML-DOM Explore HTML BasicsHTML Introduction4 min readHTML Editors4 min readHTML Basics7 min readStructure & ElementsHTML Elements4 min readHTML Attributes7 min readHTML Headings3 min readHTML Paragraphs3 min readHTML Text Formatting4 min readHTML Block and Inline Elements3 min readHTML Charsets4 min readListsHTML Lists3 min readHTML Ordered Lists5 min readHTML Unordered Lists4 min readHTML Description Lists3 min readVisuals & MediaHTML Colors11 min readHTML Links Hyperlinks2 min readHTML Images7 min readHTML Favicon4 min readHTML Video4 min readLayouts & DesignsHTML Tables9 min readHTML Iframes4 min readHTML Layout4 min readHTML File Paths3 min readProjects & Advanced TopicsHTML Forms5 min readHTML5 Semantics5 min readHTML URL Encoding4 min readHTML Responsive Web Design11 min readTop 10 Projects For Beginners To Practice HTML and CSS Skills8 min readTutorial ReferencesHTML Tags - A to Z List15+ min readHTML Attributes Complete Reference8 min readHTML Global Attributes5 min readHTML5 Complete Reference8 min readHTML5 MathML Complete Reference3 min readHTML DOM Complete Reference15+ min readHTML DOM Audio/Video Complete Reference2 min readSVG Element Complete Reference5 min readSVG Attribute Complete Reference8 min readSVG Property Complete Reference7 min readHTML Canvas Complete Reference4 min read Like