Open In App
Related Articles

HTML <label> for Attribute

Improve Article
Save Article
Like Article

The HTML <label> for Attribute is used to specify the type of form element a label is bound to


<label for="element_id">

Attribute Values: It contains the value i.e element_id which specify the id of the element that the label is bound to. 

Example: This Example that illustrates the use of for attribute in <label> element. 


<!-- HTML code to illustrates label tag -->
<!DOCTYPE html>
        HTML | for Attribute
        body {
            font-size: 20px;
<body style="text-align:center">
    <h1 style="color:green">
      HTML | &lt;label&gt;for Attribute
        <!-- Starts label tag from here -->
        <label for="student">
        <input type="radio"
        <label for="business">
        <input type="radio"
        <label for="other">
        <!-- Ends label tags here -->
        <input type="radio"



Supported Browsers: The browser supported by HTML | <label>for Attribute are listed below:

  • Google Chrome 
  • Edge version 12 and above
  • Internet Explorer 
  • Firefox
  • Opera 
  • Safari 

Last Updated : 21 Jun, 2022
Like Article
Save Article
Similar Reads
Related Tutorials