Track label Property
Example
Get the label of the text track:
var x = document.getElementById("myTrack").label;
The result of x could be:
English
Description
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
| Property | |||||
|---|---|---|---|---|---|
| label | Yes | 10.0 | Not supported | Not supported | Yes |
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
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.