Latest web development tutorials
 

Track label Property

< Track Object

Example

Get the label of the text track:

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

The result of x could be:

English


Definition and Usage

The label property sets or returns the value of the label attribute of the track.

The label attribute specifies the label/title of the text track.

The title of the text track is used by the browser when listing available text tracks.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

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

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


Syntax

Return the label property:

trackObject.label

Set the label property:

trackObject.label=label

Property Values

Value Description
label Specifies the label/title of the text track

Technical Details

Return Value: A String, representing the label/title of the text track

More Examples

Example

Set the label of text track:

document.getElementById("myTrack").label = "Norwegian";


Related Pages

HTML reference: HTML <track> label attribute


< Track Object