Using the adoptNode() Method with Embedded iframes
There’s an interesting DOM feature that I just came across that’s a method of the
document
object that allows you to remove elements from an <iframe>
that’s embedded on a page and drop them into the current page (or vice versa).
In other words, you adopt the elements from the child frame into the parent. The code for document.adoptNode()
looks like this: