THE WORLD'S LARGEST WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

Track src Property

Track Object Reference Track Object

Example

Get the URL of the track file:

var x = document.getElementById("myTrack").src;

The result of x could be:

http://www.w3schools.com/jsref/subtitles_en.vtt


Definition and Usage

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 Reference Track Object