HTML DOM Embed object

Embed object

Embed objects are new in HTML5.

An Embed object represents an HTML <embed> element.

Access Embed objects

You can use getElementById() to access the <embed> element:

var x = document.getElementById("myEmbed");

 Try It! 

Create an Embed object

You can use document.createElement() to create <embed> elements:

var x = document.createElement("myEmbed");

 Try It! 

Embed object attributes

heightSet or return the height of the embedded file (height attribute value)
srcSet or return the src attribute value (embedded file address) of the embed element
typeSet or return the type attribute value of the embed element (embedded file type)
widthSet or return the width of the embedded file (width property value)

Standard Properties and Events

Embed objects also support standard properties and events .

Related articles

HTML Reference Manual: HTML <embed> Tag