X
HOME HTML5 CSS3 JAVASCRIPT SQL PHP5 JQUERY ANGULAR BOOTSTRAP3 XML MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

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

Internet Explorer Firefox Opera Google Chrome Safari

The src property is supported Internet Explorer, Opera, and Chrome.

Note: The src property is not supported in Firefox, Safari or Internet Explorer 9 and earlier versions.


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

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE

facebook