Loading

Label Tag

  • In HTML forms, the <label> element is used to associate a text label with a form element, such as an input field or textarea.
  • This association is helpful for accessibility and usability, as it provides a clear description of the purpose of the form element.

Example:

<form>  
    <label for="firstname">First Name: </label> <br/>  
              <input type="text" id="firstname" name="firstname"/> <br/>  
   <label for="lastname">Last Name: </label>  
              <input type="text" id="lastname" name="lastname"/> <br/>  
</form>  

Output: