HTML DOM Track-objekt

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

egenskaper 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.

Standardegenskaper och händelser

Track-objektets standardstödegenskaperochHändelser.

Relaterade sidor

HTML-referenshandbok:HTML <track>-taggen