HTML LABEL <label> Tag
0 3675
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>Output:
<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>

Share:




Comments
Waiting for your comments