HTMLEmbedElement: type property
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since January 2020.
The type
property of the HTMLEmbedElement
interface returns a string that reflects the type
attribute of the <embed>
element, indicating the MIME type of the resource. It reflects the <embed>
element's type
attribute
Value
A string; the MIME type of the resource.
Examples
js
const el = document.getElementById("el");
console.log(el.type); // Output: "video/webp"
Specifications
Specification |
---|
HTML Standard # dom-embed-type |
Browser compatibility
BCD tables only load in the browser