HTML Attributes

HTML srclang attribute

Build a form with the HTML form generator

Declares the language of a text track. It is required for subtitle tracks; use a clear label to help users select the track. Applicable elements include: <track>. Check each element’s value rules. Example uses illustrative URLs or local assets; provide the corresponding files or application endpoints when running it.

Formal Syntax & Structure

html syntaxhtml
srclang="en"

Parameters & Attributes

NameTypeDescription
srclangBCP 47 language tagDeclares the language of a text track. It is required for subtitle tracks; use a clear label to help users select the track.

Working Example

Example Snippethtml
<video src="lesson.mp4" controls>  <track kind="subtitles" src="en.vtt" srclang="en" label="English"></video>
HTML Reference