YouTip LogoYouTip

Prop Track Srclang

# HTML DOM Track srclang Property [![Image 8: Track Object Reference](#) Track Object](#) ## Example Get the language code of the track text data: ```javascript var x = document.getElementById("myTrack").srclang; The output of _x_ will be: en * * * ## Definition and Usage The `srclang` property is used to set or return the value of the `srclang` attribute of a track. The `srclang` property describes the language of the track text data. If `kind="subtitles"`, this property is required. **Tip:** You can see more language code variables through the (#). * * * ## Browser Support ![Image 9: Internet Explorer](#)![Image 10: Firefox](#)![Image 11: Opera](#)![Image 12: Google Chrome](#)![Image 13: Safari](#) The `srclang` property is supported in Internet Explorer, Opera, and Chrome. **Note:** Firefox, Safari, or Internet Explorer 9 and earlier versions do not support the `srclang` property. * * * ## Syntax Return the `srclang` property: trackObject.srclang Set the `srclang` property: trackObject.srclang=language_code ## Property Values | Value | Description | | --- | --- | | _language_code_ | A two-letter language code describing the language of the track text data. | ## Technical Details | Return Value: | A string representing the language code of the track text data. | | --- | * * * ## More Examples ## Example Change the language code of the track text data: ```javascript document.getElementById("myTrack").srclang="no"; * * * ## Related Pages HTML Reference: [HTML srclang Attribute](#) * * Track Object](#)
← Prop Track ReadystateProp Track Src β†’