HTML track Tag

HTML <track>Tag: The HTML<track> tag defines the text tracks for media elements. This element is used to specify subtitles, caption files or other files containing text, that should be visible when the media is playing. And the HTML4 does not supports <track> tag. It was supported by HTML5.

HTML <track>Tag

This HTML track tag supports both the global and the event attributes.

Syntax: <track>Text</track>



Browser compatibility

The HTML track tag is supported by different types of browsers.

  • Chrome
  • Firefox
  • Opera
  • Safari
  • Internet Explorer

Attributes that are supported by the <track> tag

Attribute Value Description
default default Specifies that the track is to be enabled if the user’s preferences do not indicate that another track would be more appropriate
kind captions
chapters
descriptions
metadata
subtitles
Specifies the kind of text track
label text Specifies the title of the text track
src URL Specifies the URL of the track file
srclang lang_code Specifies the language of the track text data (required if kind=”subtitles”)