Globally declare the variable var Frame=null; , then on an event I create and fill it with the contents:
Frame = document.createElement("iframe"); Frame.id = "iframe"; Frame.style.width = "30%"; Frame.style.height = "30%"; Frame.src = targetlink; document.body.appendChild(Frame); In it, the user can perform some actions and, accordingly, its contents change.
At some point, the user clicks a button on the main page and the frame content should appear on the page itself, and the frame will close.
Attempt to do like this: document.body = Frame.document.body; does not work. How to transfer the contents of the frame?