Open In App

HTML label Attribute

The HTML label Attribute is used to specify the title of the Text Track. The title of the Text Track is used by the browser when listing available text tracks. It is used in <track> element. 

Syntax:



<track label="English"> 

HTML label Attribute Supported Tags:

HTML label Attribute Example

Example: Here is the basic implementation of HTML label Attribute.






<!DOCTYPE html>
<html>
  
<head>
    <style>
        body {
            text-align: center;
        }
        h1 {
            color: green;
        }
    </style>
</head>
  
<body>
    <h1>GeeksforGeeks</h1>
    <h2>HTML  label Attribute</h2>
  
    <video width="100" 
           height="100" 
           controls>
  
        <track src=
               id="myTrack1" 
               kind="subtitles" 
               srclang="en"
               label="English" 
               default>
  
            <source id="myTrack" 
                    src=
                    type="video/mp4">
  
    </video>
</body>
  
</html>

Output: 

Explanation:

HTML label Attribute Use Cases

1.What is the use of label Attribute in HTML ?

The label attribute in HTML is used to provide a text label or description for an element, such as an input field or a form control, improving accessibility and user experience.

Supported Browsers

The browsers supported by label Attribute are listed below: 


Article Tags :