HTML5 > Elements of HTML

Label in HTML5

How to use the label tag in HTML5


Label

Label tag is used to add the label to the input tags or check box, textarea, etc

  <h2 style="color:green"><i>Label tag is used to add labels in form controls, input tags. </i></h2>
    <label for="email"> EMAIL-ID:</label><br />
        <input type="email" name="emailid" size="30"><br /><br/>
    <label for="Password">PASSWORD</label><br />
         <input type="password"  name="password" size="40" maxlength="10" placeholder="Enter Password">
  • In the above code snippet we defined the label tag, we have label tags email and Password
  • The email label with the input tag renders the name as emailid with the size 30 
  • The label password with input tag renders the name as password with size as 40
  • The maxlength defines the length of the characters as 10
  • The placeholder  specifies a short hint that describes the expected value

output

 Views: 3921 | Post Order: 31



Write for us






Hosting Recommendations