Image

HTML & CSS - Label tag in form - Label tag in form

Label tag in form

The <label> tag allows you to click on the label, and it will be treated like clicking on the associated input element. EX
<!DOCTYPE html>
<body>
<form>  
    <label for="firstname">First Name: </label>  
              <input type="text" id="firstname" name="firstname"/> <br/>  
   <label for="lastname">Last Name: </label>  
              <input type="text" id="lastname" name="lastname"/> <br/>  
 </form>  
</body>
</html>
O/P