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