The HTML <track> srclang Attribute is used to specify the language of the track text. The srclang attribute can be applied on the <track> element:
Note: srclang attribute is required with kind = “subtitles”.
Syntax:
<track src="subtitles_en.vtt" kind="subtitles" srclang="en">
Attribute Values
- language_code: It contains the value i.e language_code It defines a two-letter language code which specify the language of the track text.
Example:
<html> <head> </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> |
chevron_right
filter_none
Output:

Supported Browsers: The browsers supported by <track> srclang Attribute are listed below:
- Google Chrome 18.0
- Internet Explorer 10.0
- Firefox 31.0
- Apple Safari 6.0
- Opera 15.0
Recommended Posts:
- HTML | srclang Attribute
- HTML | DOM Track srclang property
- HTML | <html> xmlns Attribute
- HTML | scoped Attribute
- HTML | <th> valign Attribute
- HTML | <col> align Attribute
- HTML | poster Attribute
- HTML | Class Attribute
- HTML | style attribute
- HTML | oninvalid Event Attribute
- HTML | <select> autocomplete Attribute
- HTML & CSS | Tabindex attribute & Navigation bars
- HTML | <table> bgcolor Attribute
- HTML | onsubmit Event Attribute
- HTML | onunload Event Attribute
- HTML | srcdoc Attribute
- HTML | Marquee truespeed attribute
- HTML | onkeyup Event Attribute
- HTML | ondrop Event Attribute
- HTML | <td> abbr Attribute
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


