Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / HTML

kind — text track kind

The kind attribute on track identifies a text track's purpose. Omitting it means subtitles, whereas an invalid or empty value means metadata.

Version: WHATWG HTML Living Standard; index snapshot date recorded separately

Syntax

<track kind="subtitles" src="track.vtt" srclang="en">
<track kind="captions" src="track.vtt">
<track kind="descriptions" src="track.vtt">
<track kind="chapters" src="track.vtt">
<track kind="metadata" src="track.vtt">

kind is an enumerated attribute on the track element, used inside audio or video. It identifies the purpose of an external timed text track, not its language or file format.

subtitles provides dialogue transcription or translation; captions also includes relevant sounds and music. descriptions supplies textual descriptions of visuals intended for speech synthesis. chapters provides chapter cues for navigating the media; the browser can present them as an interactive list. metadata identifies a track intended for scripts that the browser does not display.

Omitting kind means subtitles; an invalid value, including kind="", means metadata. This fallback does not make an invalid value conforming. src is required; subtitles also requires srclang containing a valid BCP 47 language tag.

The example compares the raw value from getAttribute('kind') with the effective text track kind in track.track.kind. Setting kind alone does not enable caption display.

Examples

const track = document.createElement('track');
console.log(track.track.kind);
track.setAttribute('kind', 'captions');
console.log(track.track.kind);
track.setAttribute('kind', 'invalid');
console.log(track.getAttribute('kind'));
console.log(track.track.kind);
track.setAttribute('kind', '');
console.log(track.track.kind);

Result

subtitles
captions
invalid
metadata
metadata

The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.

Sources