Open In App

HTML | DOM Embed Object

Last Updated : 11 Jul, 2025
Comments
Improve
Suggest changes
1 Likes
Like
Report
The Embed Object in HTML DOM is used to represent the <embed> element. The <embed> element can be accessed by using getElementById() method. Note: This object is new in HTML 5. Property Values:
  • height: It sets or returns the value of the height attribute.
  • src: It sets or returns the value of the src attribute of an Embed Object,
  • type: It sets or returns the value of the type attribute of an Embed Object.
  • width: It sets or returns the value of the width attribute of an Embed Object.
Syntax:
document.getElementById("ID"); 
Where ID assigned to the <embed> tag. Example 1: This example describes the getElementById() method to access the <embed> element.
Output: Before Click on the Button: After Click on the Button: Example 2: Embed Object can be created by using the document.createElement Method.
Output: Before Click on the Button : After Click on the Button: Supported Browsers: The browser supported by DOM Embed Object are listed below:
  • Google Chrome
  • Internet Explorer
  • Firefox
  • Opera
  • Safari

Article Tags :

Explore