Easy Tutorial
❮ Event Onload Prop Datetime Local Autofocus ❯

Source type Attribute

Source Object

Example

Returns the MIME type of the media resource:

x Output result is:


Definition and Usage

The type attribute sets or returns the value of the type attribute of the <source> element.

The type attribute specifies the MIME type of the media resource.

Note: The <source> element is new in HTML5.


Browser Support

All major browsers support the type attribute.


Syntax

Return the type attribute:

Set the type attribute:

Attribute Values

Value Description
MIME_type Specifies the MIME type of the media resource. <br> <br>Common MIME types: <br>Video: video/ogg<br> video/mp4<br> video/webm<br>Audio: audio/ogg<br> audio/mpeg<br>See IANA MIME Types

Technical Details

| Return Value: | A string, representing the MIME type of the media resource. | | --- | --- |


Related Articles

HTML Reference: HTML <source> type Attribute


Source Object

❮ Event Onload Prop Datetime Local Autofocus ❯