Thanks to visit codestin.com
Credit goes to developer.mozilla.org

此页面由社区从英文翻译而来。了解更多并加入 MDN Web Docs 社区。

View in English Always switch to English

HTMLIFrameElement:name 属性

基线 广泛可用

自 2015年7月 起,此特性已在主流浏览器中得到支持,可在大多数设备和浏览器版本中正常使用。

HTMLIFrameElement 接口的 name 属性是反映 <iframe> 元素的 name 属性的字符串值,表示 <iframe> 元素的特定名称。

一个字符串。

示例

html
<iframe id="el" name="example"></iframe>
js
const el = document.getElementById("el");
console.log(el.name); // 输出:“example”

规范

规范
HTML
# dom-iframe-name

浏览器兼容性