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
embedObject.type = MIME_type
Property Values:
- MIME_type: It contains a single value MIME-type which is used to specify the target URL.
Return Values: It returns a string value that represents the MIME type of the linked Document.
Example:
HTML
<!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"
< br >
< button onclick = "GFGfun()" >
Try it
</ button >
< p id = "pid" ></ p >
< script >
function GFGfun() {
let idtype =
document.getElementById("embedID").type;
document.getElementById("pid").innerHTML
= idtype;
}
</ script >
</ center >
</ body >
</ html >
|
Output:
Supported Browsers: The browsers supported by DOM embed type property are listed below:
- Google Chrome 1 and above
- Edge 79 and above
- Internet Explorer not supported
- Firefox 1 and above
- Opera 12.1 and above
- Safari 4 and above
Last Updated :
19 Jun, 2023
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...