HTML | DOM embed type property

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:



filter_none

edit
close

play_arrow

link
brightness_4
code

<!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>

chevron_right


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

full-stack-img




My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :
Practice Tags :


Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.