HTML <iframe> nameAttribute

HTML iframe 标签参考手册HTML <iframe> Tag

Example

<iframe> as a link target:

<iframe src="demo_iframe.htm.html" name="iframe_a"></iframe>

<a href="http://www.w3cschool.cc" target="iframe_a">example.com</a>

Try it yourself »

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the name attribute.


Definition and Usage

The name attribute specifies the name of the <iframe>.

The name attribute is used to reference an element in JavaScript, or as the value of the target attribute of an <a> or <form> element, or as the value of the formtarget attribute of an <input> or <button>.


Differences between HTML 4.01 and HTML5

None.


Differences between HTML 4.01 and XHTML

In XHTML, the name attribute is deprecated and will be removed. Use the id attribute instead.


Syntax

<iframe name="name">

Attribute Values

Value Description
name Specifies the name of the <iframe>.


HTML iframe 标签参考手册HTML <iframe> Tag Other Extensions