English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
This article introduces how to specify the name of <iframe> using the HTML iframe name attribute. This name attribute can be used to reference elements in JavaScript, or as the value of the target attribute of <a> or <form> elements, or as the value of the formtarget attribute of <input> or <button> elements.
The name is used as the link target <iframe>:
<!DOCTYPE html> <html> <head> <title>HTML:<iframe> name attribute - Basic Tutorial Website oldtoolbag.com</title> <body> <iframe src="demo-iframe.html" name="iframe_a"> <p>Your browser does not support iframe</p> </iframe> <a href="//www.oldtoolbag.com" target="iframe_a">oldtoolbag.com</a> <p>Notice: Since the link target matches the iframe name, the link will open in the iframe.</p> </body> </html>Test See ‹/›
IEFirefoxOperaChromeSafari
All major browsers support the name attribute.
The name attribute specifies the name of the <iframe>.
This name attribute can be used to reference elements in JavaScript, or as the value of the target attribute of an <a> or <form> element, or as the formtarget attribute value of an <input> or <button> element.
None.
In XHTML, it is not recommended to use the name attribute, as it has been removed. Please use the id attribute instead.
<iframe name="name">
Value | Description |
---|---|
name | Specify the name of the <iframe>. |