Advertisement
Home Open Editor ❯

HTML Audio/Video DOM currentSrc Property

Example

var vid = document.getElementById("myVideo");

function myFunction() {
  alert(vid.currentSrc);
}

Try this code ❯

Meaning

The currentSrc property returns the URL of the current audio/video. If no audio/video is set, an empty string is returned.

This property is read-only and use the src property to set the URL of a video file.


Standard Syntax

audio|video.currentSrc


Advertisement

Home Open Editor ❯
Advertisement