Back to Content

HTMLTrackElement: label property

files/en-us/web/api/htmltrackelement/label/index.md

latest692 B
Original Source

{{ApiRef("HTML DOM")}}

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

Value

A string.

Example

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

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also

  • {{domxref("HTMLTrackElement.track")}}
  • {{domxref("HTMLTrackElement.kind")}}