Open In App

How to specify name of an iframe element using HTML ?

Improve
Improve
Like Article
Like
Save
Share
Report

The iframe in HTML stands for Inline Frame. The “iframe” tag defines a rectangular region within the document in which the browser can display a separate document, including scrollbars and borders. An inline frame is used to embed another document within the current HTML document.

The HTML iframe name attribute is used to specify a reference for an <Iframe> element. The name attribute is also used as a reference to the elements in a JavaScript.

Syntax:

<iframe name="name">

Example:

HTML




<!DOCTYPE html>
<html>
  
<body>
    <center>
        <h1 style="color:green">
            GeeksforGeeks
        </h1>
  
        <h2>
            How to specify the name of
            iframe element using HTML?
        </h2>
  
        <iframe src="" height="200" 
                width="400" name="myGeeks">
        </iframe>
        <br><br>
        <a href="https://www.geeksforgeeks.org/" 
               target="myGeeks">
            GeeksforGeeks
        </a>
    </center>
</body>
  
</html>


Output:

Supported Browsers:

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Apple Safari
  • Opera

Last Updated : 26 Nov, 2020
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads