Embed type Property - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Embed

Description

The height property sets or gets the type attribute in an <embed> element, which identifies the MIME type of the embedded content.

Set the type property with the following Values

Value Description
MIME_type The MIME type of the embedded content.

Return Value

A String, representing the MIME type of the embedded content

The following code shows how to return the MIME type of the embedded content:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<embed id="myEmbed" src="helloworld.swf" type="application/x-shockwave-flash">

<button onclick="myFunction()">Test</button>

<p id="demo"></p>

<script>
function myFunction() {/*from   w  ww.  j  ava  2 s .c o m*/
    var x = document.getElementById("myEmbed").type;
    document.getElementById("demo").innerHTML = x;
}
</script>

</body>
</html>

Related Tutorials