Track label attribute

Definition and Usage

label Sets or returns the value of the track's label attribute.

The HTML label attribute specifies the text track's label/title.

When listing the available text tracks, the browser will use the text track's title.

See also:

HTML Reference Manual:HTML <track> label Attribute

Instance

Example 1

Get the text track label:

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

The result of x could be:

English

Example 2

Set the text track label:

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

Syntax

Return label attribute:

trackObject.label

Set label attribute:

trackObject.label = label

Attribute Value

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

Technical Details

Return Value: A string value representing the label/title of the text track.

Browser Support

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Supported 10.0 Not Supported Not Supported Supported