Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. HTMLTrackElement
  4. kind

HTMLTrackElement: kind property

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨July 2015⁩.

Thekind property of theHTMLTrackElement interface represents the type of track, or how the text track is meant to be used. It reflects the<track> element's enumeratedkind attribute.

If nokind is set,subtitles is used. If the attribute is not set to one of the valid enumerated values, it is invalid andmetadata is used. Other valid values includecaptions,descriptions, andchapters.

Value

A string; lowercasecaptions,descriptions,chapters,subtitles ormetadata.

Example

Given the following:

html
<track src="track.vtt" />

We get the following results:

js
const trackElement = document.getElementById("exampleTrack");// missing valueconsole.log(trackElement.kind); // "subtitles"trackElement.kind = "INVALID";// invalid valueconsole.log(trackElement.kind); // "metadata"trackElement.kind = "CAPTIONS";// valid valueconsole.log(trackElement.kind); // "captions"

Specifications

Specification
HTML
# dom-track-kind

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp