HTML DOM embeds property
Example
Count how many are in the document
var
x
=
document
.
embeds
.
length
;
Try it »
Definition and usage
embeds returns all in the document
Note: The order of elements in the collection is their order in the source code.
Tip: See also Embed object.
Browser support
| Union | |||||
|---|---|---|---|---|---|
| embeds | Yes | Yes | Yes | Yes | Yes |
Syntax
document.embeds
property
| property | Description |
|---|---|
| length | Returns the number of in the collection |
**注意:** 该属性是只读的。 |
Method
| Method | Description |
|---|---|
| [index] | Returns the element corresponding to the specified index (starting from 0) in the collection |
**注意:** 如果索引值超出范围,返回 null。 |
| item(index) | Returns the element corresponding to the specified index (starting from 0) in the collection
**注意:** 如果索引值超出范围,返回 null。 |
| namedItem(id) | Returns the element corresponding to the specified index in the collection
**注意:** 如果 id 不存在,则返回 null。 |
Technical Details
| DOM version: | Core Level 3 Document Object |
|---|---|
| Return Value: | HTMLCollection object, representing all in the document |
Related pages
JavaScript Reference Manual: HTML DOM Embed object
HTML Reference Manual: HTML
Document Object