MDN self-hosted library · e01.org

HTMLTrackElement: label property

HTML DOM

Open notebook · 1 cells web-api-instance-property upstream source

HTML DOM

The label property of the HTMLTrackElement represents the user-readable title displayed when listing subtitle, caption, and audio descriptions for a track. It reflects the track element's label attribute.

Value

A string.

Example

const trackElement = document.getElementById("exampleTrack");
console.log(`Track's label: ${trackElement.label}`);
trackElement.label = "Updated label";

Specifications

Browser compatibility

See also

  • HTMLTrackElement.track
  • HTMLTrackElement.kind