document.embeds

本页内容
上一节: Prop_doc_domain 下一节: Coll_doc_forms

HTML DOM embeds 属性

Document 对象

计算文档中有多少个 <embed> 元素:


示例

var x = document.embeds.length;

定义与用法

embeds 返回文档中所有 <embeds> 元素的集合。

注意: 元素在集合中的顺序是它们在源代码中的顺序。

提示: 也可以参考 Embed 对象

浏览器支持

集合 Chrome Internet Explorer / Edge Firefox Safari Opera
embeds Yes Yes Yes Yes Yes

语法

document.embeds

属性

属性 描述
length 返回集合中 <embed> 元素的数量。 注意: 该属性是只读的。

方法

方法 描述
[index] 返回集合中指定索引(从 0 开始)对应的 <embed> 元素 。注意: 如果索引值超出范围,返回 null。
item(index) 返回集合中指定索引(从 0 开始)对应的 <embed> 元素 。注意: 如果索引值超出范围,返回 null。
namedItem(id) 返回集合中指定索引对应的 <embed> 元素。 注意: 如果 id 不存在,则返回 null。

技术细节

DOM 版本: Core Level 3 Document Object
返回值: HTMLCollection 对象,表示文档中所有的 <embed> 元素。元素在集合中的排序是其在源代码中的排序。

相关页面

JavaScript 参考手册: HTML DOM Embed 对象

HTML 参考手册: HTML <embed> 标签

Document 对象

上一节: Prop_doc_domain 下一节: Coll_doc_forms
此页面最后编辑于2022年8月19日 (星期五) 11:21。