A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.geeksforgeeks.org/html/html-track-srclang-attribute/ below:

HTML <track> srclang Attribute - GeeksforGeeks

HTML <track> srclang Attribute

Last Updated : 12 Jul, 2025

The HTML <track> element's srclang attribute specifies the language of the text track's data. It is used in <track> elements within <video> or <audio> tags, defining the language of subtitles, captions, or other track content using language codes like "en" for English.

Note: srclang attribute is required with kind = “subtitles”.

Syntax
<track src="subtitles_en.vtt" kind="subtitles" srclang="en"> 

Attribute Values

Example: In this example we demonstrates a video element with a track for subtitles. The srclang attribute specifies the subtitle language as English for the video.

html
<html>

<head>
    <title>
        HTML Track srclang Attribute
    </title>
</head>

<body style="text-align: center">
    <h1 style="color: green">
        GeeksforGeeks
    </h1>
    <h2>HTML Track srclang Attribute</h2>

    <video width="600" height="400" controls>

        <track src="CSS-animation-duration02.mp4" 
               id="myTrack1" 
               kind="subtitles" 
               srclang="en" 
               label="English">

        <source id="myTrack" 
                src="CSS-animation-duration02.mp4" 
                type="video/mp4">
    </video>
</body>

</html>

Output:

Supported Browsers

The browsers supported by <track> srclang Attribute are listed below:



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4