type property

Gets or sets the MIME type of a media resource.

HTML5 A vocabulary and associated APIs for HTML and XHTML, Section 4.8.8Internet Explorer 9




type = object.type


Property values

Type: string

A valid MIME type that specifies the type of media resource that src points to.

Standards information


You can use the codecs parameter to specify the exact encoding of the media resource. The following code example shows a source element that uses a type attribute and the codecs parameter to specify how a video was encoded.

<source src="video.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'>

See also

source element