HTML Code:
<!DOCTYPE html><!-- Declaration specifying the document type -->
<html><!-- Opening tag for the root element of the HTML document -->
<head><!-- Opening tag for the document's header section -->
<meta charset="utf-8"><!-- Metadata tag specifying the character encoding of the document -->
<title>How to specify the name of an iframe element</title><!-- Title of the HTML document -->
</head><!-- Closing tag for the document's header section -->
<body><!-- Opening tag for the document's body section -->
<iframe src="https://www.w3resource.com/html-css-exercise/basic/solution/article-answer.html" name ="iframe_a"><!-- Inline frame element displaying content from an external source with the name attribute set to "iframe_a" -->
</iframe><!-- Closing tag for the iframe element -->
<a href="https://www.w3resource.com/html-css-exercise/basic/solution/article-answer.html" target="iframe_a">w3resource</a><!-- Anchor element linking to an external URL with the target attribute set to "iframe_a" -->
</iframe><!-- Redundant closing tag for the iframe element -->
<p><b>Note:</b> Because the target of the link matches the name of the iframe, the link will open in the iframe.</p><!-- Paragraph element providing a note -->
</body><!-- Closing tag for the document's body section -->
</html><!-- Closing tag for the root element of the HTML document -->
Explanation:
Live Demo:
See the Pen iframe-name-answer by w3resource (@w3resource) on CodePen.
See the solution in the browser
Supported browser
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4