Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

HTML | DOM embed type property

  • Last Updated : 31 Oct, 2019

The DOM embed height property in HTML is used to set or return the value of the type attribute in an embed element. The type attribute specifies the MIME type of the embedded content.

Syntax:

  • Return the type property:
    embedObject.type
  • Set the type property:
    embedObject.type = MIME_type

Property Values:

  • MIME_type: It contains single value MIME-type which is used to specify the target URL.

Return Values: It returns a string value which represents the MIME type of the linked Document.

Example:




<!DOCTYPE html>
<html>
  
<head>
    <title>HTML DOM Embed type Property</title>
</head>
  
<body>
    <center>
        <h1 style="color:green"
            GeeksforGeeks 
        </h1>
  
        <embed id="embedID"
               type="application/x-shockwave-flash" 
               src="https://ide.geeksforgeeks.org">
        <br>
  
        <button onclick="GFGfun()">
            Try it
        </button>
  
        <p id="pid"></p>
  
        <script>
            function GFGfun() {
                var idtype = 
                document.getElementById("embedID").type;
  
                document.getElementById("pid").innerHTML
                        = idtype;
            }
        </script>
    </center>
</body>
  
</html>

Output:
Before clicking the button:

After clicking the button:

Supported Browsers: The browsers supported by DOM embed type property are listed below:

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Apple Safari
  • Opera




My Personal Notes arrow_drop_up

Start Your Coding Journey Now!