Firefox Tomorrow

web api instance property

HTMLSourceElement: type property

View on MDN ↗

The type property of the HTMLSourceElement interface is a string representing the MIME type of the media resource.

It reflects the type attribute of the <source> element.

Value

A string.

Examples

<video>
  <source
    id="el"
    src="/firefox/mdn-asset-missing.svg"
    type="video/webp"
    media="screen and (width >= 600px)" />
</video>
const el = document.getElementById("el");
console.log(el.type); // Output: "video/webp"

Specifications

SpecificationsStandards references are available on the canonical MDN page.

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.

See also