HTML Audio/Video DOMsrcProperties
HTML Audio/Video DOM Reference Manual
Examples
Change the source of the video:
myVid=document.getElementById("video1");
myVid.src="movie.ogg.html";
myVid.src="movie.ogg.html";
Try it Yourself »
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 property:
audio|video.src=URL
Return the src property:
audio|video.src
Property Values
| Value | Description |
|---|---|
| URL | Specifies the URL of the audio/video source. Possible values:
|
Technical Details
| Return value: | A string value, the current audio/video source. |
|---|
HTML Audio/Video DOM Reference Manual Other Extensions