MDN self-hosted library · e01.org

HTMLTrackElement: src property

HTML DOM

Open notebook · 1 cells web-api-instance-property upstream source

HTML DOM

The src property of the HTMLTrackElement interface reflects the value of the track element's src attribute, which indicates the URL of the text track's data.

Value

A string containing the URL of the text track data.

Example

const trackElement = document.getElementById("exampleTrack");
console.log(`Track's URL: ${trackElement.src}`);
trackElement.src = "newTrack.vtt";

Specifications

Browser compatibility

See also

  • HTMLTrackElement
  • track