HTML Audio/Video DOM src Attribute
Example
Change the video source:
myVid=document.getElementById("video1"); myVid.src="movie.ogg";
Definition and Usage
The src attribute sets or returns the current source of the audio/video.
Browser Support
All major browsers support the src attribute, except for Internet Explorer.
Syntax
Set src attribute:
audio|video.src=URL
Return src attribute:
audio|video.src
Attribute value
Value | Description |
---|---|
URL |
Specifies the URL of the audio/video source. Possible values:
|
Return value
Type | Description |
---|---|
String value | Current audio/video source. |