Label Tag in HTML || HTML Lagel Tag
×

HTML LABEL <label> Tag

2662

The <label> tag is used for generating caption/Heading/text label for a form control in HTML form. The label is a simple text that tells about specific form input fields in which users can select and put the data correctly.

Label tag is used with elements such as <textarea>, <input>, <output>, <meter>, <progress>, <select> or <button> tag.

For example, an input field that required the user's first name then you have a label of "First Name: ".

The <label> tag has both start and end tags. It is written as <label></label> with the label text inserted between the program.

<!DOCTYPE>
<html>
<head>
<title> Label Tag </title>
</head>
<body>
<label for="email">EMAIL-ID:<br />
<input type="email" value="" name="emailid" size="30"
placeholder="Enter a valid email address"><br />
<label for="phone">PHONE NO:<br />
<input type="text" value="" name="phoneno" size="30"
maxlength="10" placeholder="Enter a valid phone number" pattern="[0-9]{10}"><br />
</body>
</html>

Output:




Best WordPress Hosting


Share:


Discount Coupons

Get a .COM for just $6.98

Secure Domain for a Mini Price



Leave a Reply


Comments
    Waiting for your comments