HTML | srclang Attribute

The 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”.

Example: Below is the example of srclang attribute.





<body style="text-align: center">
    <h1 style="color: green">
    <h2>HTML srclang Attribute</h2>
    <video width="100"
        <track src=
            <source id="myTrack"
      Click the button to get 
      the language of the track.
    <button onclick="myFunction()">
        Get srclang
    <p id="gfg"></p>
    <!-- Script to get the 
      value of srclang property -->
        function myFunction() {
            var x =
                "gfg").innerHTML = x.srclang;


Output: Click the button to get the value of srclang attribute:

Supported Browsers:

  • Google Chrome 18.0
  • Internet Explorer 10.0
  • Firefox 31.0
  • Opera 15.0
  • Safari 6.0

My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using or mail your article to 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.

Article Tags :
Practice Tags :

Be the First to upvote.

Please write to us at to report any issue with the above content.