TextTrack: id property - Web APIs | MDN

Value

A string containing the ID, or an empty string.

Examples

In the following example the value of id is printed to the console.

js

const video = document.querySelector("video");
const track = video.addTextTrack("captions", "Captions", "en");
track.mode = "showing";
console.log(track.id);

Specifications

Specification
HTML
# dom-texttrack-id-dev

Browser compatibility

Help improve MDN

Learn how to contribute

This page was last modified on by MDN contributors.