HTML DOM Document embeds property
- Forrige side domConfig
- Næste side execCommand()
- Gå tilbage til niveauet over HTML DOM Documents
Definition and usage
embeds
The property returns a collection of all <embed> elements in the document.
embeds
The property is read-only.
Warning
Most browsers no longer support embedded applets or plugins.
No browser supports embedded ActiveX controls anymore.
Shockwave Flash is also disabled in modern browsers.
Suggestion
To embed images, use <img> tag.
To embed HTML, use <iframe> tag.
To embed video or audio, use <video> or <audio> tag.
See also:
Instance
Number of <embed> elements in the document:
let num = document.embeds.length;
Syntax
document.embeds
Property
Property | Description |
---|---|
length | The number of <embed> elements in the collection. |
Method
Method | Description |
---|---|
[index] |
Returns the element with the specified index (starting from 0). If the index is out of range, returns null. |
item(index) |
Returns the element with the specified index (starting from 0). If the index is out of range, returns null. |
namedItem(id) |
Returns an element with the specified id element. If id If it does not exist, returns null. |
Return value
Type | Description |
---|---|
Object |
HTMLCollection object. All <embed> elements in the document. is sorted in the order they appear in the source code. |
Browser support
document.embeds
It is a feature of DOM Level 3 (2004).
All browsers support it:
Chrome | IE | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
Chrome | IE | Edge | Firefox | Safari | Opera |
Supporter | 9-11 | Supporter | Supporter | Supporter | Supporter |
- Forrige side domConfig
- Næste side execCommand()
- Gå tilbage til niveauet over HTML DOM Documents