THE WORLD'S LARGEST WEB DEVELOPER SITE

HTML DOM embeds Collection

❮ Document Object

Example

Find out how many <embed> elements there are in the document:

var x = document.embeds.length;

The result of x will be:

2
Try it Yourself »

Definition and Usage

The embeds collection returns a collection of all <embeds> elements in the document.

Note: The elements in the collection are sorted as they appear in the source code.

Tip: Also look at the Embed Object.


Browser Support

Collection
embeds Yes Yes Yes Yes Yes

Syntax

document.embeds

Properties

Property Description
length Returns the number of <embed> elements in the collection.

Note: This property is read-only

Methods

Method Description
[index] Returns the <embed> element from the collection with the specified index (starts at 0).

Note: Returns null if the index number is out of range
item(index) Returns the <embed> element from the collection with the specified index (starts at 0).

Note: Returns null if the index number is out of range
namedItem(id) Returns the <embed> element from the collection with the specified id.

Note: Returns null if the id does not exist

Technical Details

DOM Version: Core Level 3 Document Object
Return Value: An HTMLCollection Object, representing all <embed> elements in the document. The elements in the collection are sorted as they appear in the source code

Related Pages

JavaScript reference: HTML DOM Embed Object

HTML reference: HTML <embed> tag


❮ Document Object