Track src Property
Example
Get the URL of the track file:
var x = document.getElementById("myTrack").src;
The result of x could be:
https://www.w3schools.com/jsref/subtitles_en.vtt
Description
The src property sets or returns the value of the src attribute of the track.
The src attribute specifies the URL of the track file.
Browser Support
Property | |||||
---|---|---|---|---|---|
src | Yes | 10.0 | Not supported | Not supported | Yes |
Syntax
Return the src property:
trackObject.src
Set the src property:
trackObject.src = URL
Property Values
Value | Description |
---|---|
URL | Specifies the URL of the track file |
Technical Details
Return Value: | A String, representing the URL of the track file. Returns the entire URL, including the protocol (like http://) |
---|
More Examples
Example
Change the URL of the track file:
document.getElementById("myTrack").src = "subtitles_no.vtt";
Related Pages
HTML reference: HTML <track> src attribute
❮ Track Object
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.