The opener is who opens mine. For example, page A uses window.open to pop up the window of page B, then the window where page A is located is the opener of page B. Page A can be accessed through the opener object on page B.
Parent represents the parent window. For example, if page A uses iframe or frame to call page B, then the window where page A is located is the parent of page B. In JS, window.opener is just a reference to the pop-up window's parent window. For example: in a.html, window.open opens a new window b.html by clicking a button. Then in b.html, you can reference a.html through window.opener (omitted and written as opener), including the document and other objects of a.html, and operate the content of a.html.
If this reference fails, null will be returned. Therefore, before calling the opener object, you must first determine whether the object is null, otherwise a JS error of "the object is empty or does not exist" will occur.
Example:
aa.html
is written as:
window.opener.document.getElementById("name").value = "Input data";
window.opener.document.getElementById( "name").innerHTML= "Input data";