Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML Audio/Video DOM currentSrc Property

HTML Audio/Video DOM currentSrc Property

HTML audio/video Tag Reference HTML Audio/Video DOM Reference

Example

Get the URL of the current video:

myVid=document.getElementById("video1");

alert(myVid.currentSrc);

Try it »


Definition and Usage

The currentSrc property returns the URL of the current audio/video.

If the audio/video is not set, an empty string is returned.


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the currentSrc attribute.

**Note:** Internet Explorer 8 and earlier versions do not support this property.


Syntax

audio|video

.currentSrc

Technical Details

Return Value: A string value representing the current URL of the audio/video.

HTML audio/video Tag Reference HTML Audio/Video DOM Reference