How to force a link from an iframe to be opened in the parent window with HTML?

Spread the love

Sometimes, we want to force a link from an iframe to be opened in the parent window with HTML.

In this article, we’ll look at how to force a link from an iframe to be opened in the parent window with HTML.

How to force a link from an iframe to be opened in the parent window with HTML?

To force a link from an iframe to be opened in the parent window with HTML, we set the target attribute to _parent.

For instance, we write

<a target="_parent" href="http://url.org">link</a>

to set the link’s target attribute to _parent to open the URL in the iframe’s parent window.

Conclusion

To force a link from an iframe to be opened in the parent window with HTML, we set the target attribute to _parent.

Leave a Reply

Your email address will not be published.