Latest web development tutorials

HTML DOM Track src attribute

Track Object Reference Track Objects

Examples

Get URL address track of file:

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

x output values:

http://www.w3cschool.cc/jsref/subtitles_en.vtt


Definition and Usage

src attribute is used to set the value of the src attribute will return the track.

src attribute describes the URL address of the track file.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Internet Explorer, Opera, and Chrome supports the src attribute.

Note: Firefox, Safari or Internet Explorer 9 and earlier versions of IE do not support the src attribute.



grammar

Back src attribute:

trackObject .src

Setting the src attribute:

trackObject .src= URL

Property Value

描述
URL 描述了轨道文件的 URL

technical details

return value: String that represents the URL text track, returning entity URL, including the protocol (such as http: //)


More examples

Examples

Modify the track file URL:

document.getElementById("myTrack").src="subtitles_no.vtt";



Related Pages

HTML Reference Manual: HTML <Track> the src attribute


Track Object Reference Track Objects