HTML DOM Document embeds
Example
Number of <embed> elements in a document:
let num = document.embeds.length;
Try it Yourself »
Definition and Usage
The embeds
property returns a collection of all <embed> elements in the document.
The embeds
property is read-only.
Warning
Most browsers no longer support embedded Applets or Plug-ins.
Embedded ActiveX controls are no longer supported in any browsers.
Shockwave Flash has also been turned off in modern browsers.
Suggestions
To embed a picture, use the <img>
tag.
To embed HTML, use the <iframe>
tag.
To embed video or audio, use a <video>
or <audio>
tag.
See Also:
Syntax
document.embeds
Properties
Property | Description |
length | The number of <embed> elements in the collection. |
Methods
Method | Description |
[index] | Returns the element with the specified index (starts at 0). Returns null if the index is out of range. |
item(index) | Returns the element with the specified index (starts at 0). Returns null if the index is out of range. |
namedItem(id) | Returns the element with the specified id. Returns null if the id does not exist. |
Return Value
Type | Description |
Node list | An HTMLCollection. All <embed> elements in the document. Sorted as they appear in the source code. |
Browser Support
document.embeds
is a DOM Level 3 (2004) feature.
It is fully supported in all browsers:
Chrome | Edge | Firefox | Safari | Opera | IE |
Yes | Yes | Yes | Yes | Yes | 9-11 |