HTML Audio/Video DOM src Property
HTML Audio/Video DOM Reference
Example
Change the source of the video:
myVid=document.getElementById("video1");
myVid.src="movie.ogg";
Try it »
Definition and Usage
The src property sets or returns the current source of the audio/video.
Browser support





Internet Explorer 10, Firefox, Opera, Chrome, and Safari support the src property.
**Note:** Internet Explorer 9 and earlier versions do not support the src property.
Syntax
Set the src attribute:
audio|video
.src=
URL
Return the src attribute:
audio|video
.src
Attribute values
| Value | Description |
|---|---|
| URL | Specifies the URL of the audio/video source.
Possible values: |
Technical Details
| Return Value: | A string value, the current source of the audio/video. |
|---|
HTML Audio/Video DOM Reference