<iframe src="" name="">

Browser
  • IE
  • Cr
  • Sf
  • Fx
  • O
Type

The name attribute of the IFAME element defines a unique name for the iframe.


<iframe src="example.html" name="test"></iframe>

Attribute Value Explanation
name=" " frame name arbitrary name
Frame name
  • Frame names must start in the alphabet.
    name="a001"
  • The following symbols can be included in a frame name.
    hyphen(-), underscore(_), colon(:), period(.)
    name="frame_name"

The frame name is used for the target attribute of the A element and the target attribute of the FORM element.

Example


<ul>
<li><a href="iexample_a.html" target="top">The red page opens in the top frame</a></li>
<li><a href="iexample_b.html" target="top">The green page opens in the top frame</a></li>
<li><a href="iexample_c.html" target="top">The yellow page opens in the top frame</a></li>
</ul>

<ul>
<li><a href="iexample_a.html" target="bottom">The red page opens in the bottom frame</a></li>
<li><a href="iexample_b.html" target="bottom">The green page opens in the bottom frame</a></li>
<li><a href="iexample_c.html" target="bottom">The yellow page opens in the bottom frame</a></li>
</ul>

<p><iframe src="iexample_a.html" width="300" height="80" name="top">Alternate content</iframe></p>

<p><iframe src="iexample_a.html" width="300" height="80" name="bottom">Alternate content</iframe></p>

Output