HTML DOM Track object

Track object

The Track object is a new object in HTML5.

The Track object represents the HTML <track> element.

Access Track object

You can access the <track> element by using getElementById():

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

Create Track object

You can create a <track> element by using the document.createElement() method:

var x = document.createElement("TRACK");

Track object properties

Properties Description
default Set or return the default state of the track.
kind Set or return the value of the kind attribute of the track.
label Set or return the value of the label attribute of the track.
readyState Return the current state of the track resource.
src Set or return the value of the src attribute of the track.
srclang Set or return the value of the srclang attribute of the track.
track Return the TextTrack object representing the text track data of the track element.

Standard properties and events

Track object supports standardsPropertiesandEvents.

Related pages

HTML reference manual:HTML <track> tag