Horje
How to create HTML Iframe - Target for a Link

An iframe can be used as the target frame for a link.


Full Example of Iframe - Target for a Link

The target attribute of the link must refer to the name attribute of the iframe:
index.html
Example: HTML
<!DOCTYPE html>
<html>
<body>

<h2>Iframe - Target for a Link</h2>

<iframe src="https://itupto.com" name="iframe_a" height="300px" width="100%" title="Iframe Example"></iframe>

<p><a href="https://itupto.com" target="iframe_a">Itupto.com</a></p>

<p>When the target attribute of a link matches the name of an iframe, the link will open in the iframe.</p>

</body>
</html>

Output should be:

Full Example of Iframe - Target for a Link





Related Articles
What is HTML Iframes HTML Iframes
How to set Iframe Height and Width HTML Iframes
How to remove Iframe Border HTML Iframes
How to create HTML Iframe - Target for a Link HTML Iframes

Single Articles
Full Example of Iframe - Target for a LinkHTML Iframes

Read Full:
HTML Iframes
Category:
Web Tutorial
Sub Category:
HTML Iframes
Uploaded:
1 year ago
Uploaded by:
Admin
Views:
82


Reffered: https://www.w3schools.com/html/tryit.asp?filename=tryhtml_iframe_target

Share on: