The Source object represents an HTML-lt;source-and-gt; element.
You can use getElementById() to access the elements:
varx = document.getElementById("mySource"); try it
You can use the document.createElement() method to create an element:
var x = document.createElement("SOURCE"); try it
Attributes | describe |
---|---|
media | 设置或返回 <source> 元素中 media 属性的值。 |
src | 设置或返回 <source> 元素中 src 属性的值。 |
type | 设置或返回 <source> 元素中 type 属性的值。 |
Source objects also support standard properties and events.
HTML tutorial: HTML5 Video
HTML tutorial: HTML5 Audio (audio).
HTML Reference Manual: HTML .lt;source> Tags