If you have already register Login here.
HTML Label Tag
The <label> tag is used to specify a label for an <input> element. It adds a label to a form control such as text, email, password, textarea etc.
The <label> element does not render as anything special for the user. However, it provides a usability improvement for mouse users, because if the user clicks on the text within the <label> element, it toggles the control.
The for attribute of the <label> tag should be equal to the id attribute of the related element to bind them together.
Example of HTML label tag.
<label for="name">Name:<br /> <input type="text" value="" name="name" size="30"
placeholder="Enter a valid Name"><br /><br />
<label for="phone">Mobile NO:<br /> <input type="text" value="" name="mobile" size="30"
maxlength="10" placeholder="Enter a valid phone number" pattern="[0-9]{10}"><br /><br />
Output
Note : A label can be bound to an element either by using the "for" attribute, or by placing the element inside the <label> element.
© 2025 Easy To Learning. All Rights Reserved | Design by Easy To Learning