HTML DOM Source type property
Examples
Returns the MIME type of property:
var x = document.getElementById("mySource").type;
x The output is:
audio/mpeg
try it"
Definition and Usage
type property sets or returns the value of the type property <source> element.
type attribute specifies the MIME type of property.
Note: <source> element is new in HTML5.
Browser Support
All major browsers support the type attribute.
grammar
Returns type attributes:
sourceObject .type
Setting type attributes:
sourceObject .type=MIME_type
Property Value
值 | 描述 |
---|---|
MIME_type | 规定媒体资源的 MIME 类型。 常见的 MIME 类型: 视频:
|
technical details
return value: | String representing the MIME type of property. |
---|
related articles
HTML Reference Manual: HTML <Source> of the type attribute