HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
HTML Audio/Video DOM Reference : Change the source of the video
The src property sets or returns the current source of the audio/video.
The source is the actual location (URL) of the audio/video file.
The numbers in the table specify the first browser version that fully supports the property.
Property | |||||
---|---|---|---|---|---|
src | Yes | 9.0 | 3.5 | Yes | Yes |
Return the src property:
Set the src property:
Value | Description |
---|---|
URL | Specifies the URL of the audio/video source.
Possible values:
|
Return Value: | A String, representing the URL of the audio/video file. Returns the entire URL, including the protocol (like http://) |
---|
Get the source (URL) of a video:
var vid = document.getElementById("myVideo").src;
❮ HTML Audio/Video DOM Reference