Javascript Reference - HTML DOM Embed type Property








The type attribute of the embed element specifies the MIME type of the embedded content.

The type property sets or gets the type attribute in an <embed> element.

Browser Support

type Yes Yes Yes Yes Yes

Syntax

Return the type property.

var v = embedObject.type

Set the type property.

embedObject.type=MIME_type




Property Values

Value Description
MIME_type The MIME type of the embedded content.

Return Value

A String type value representing the MIME type of the embedded content.

Example

The following code shows how to get the MIME type of the embedded content.

<!DOCTYPE html>
<html>
<body>
<embed id="myEmbed" src="notExist.swf" type="application/x-shockwave-flash">
<p id="demo"></p>
<button onclick="myFunction()">test</button>
<script>
function myFunction() {
    var x = document.getElementById("myEmbed").type;
    document.getElementById("demo").innerHTML = x;
}
</script>
</body>
</html>