The <label> tag |
|
Defines a label to a control. If you click the text within the label element, it is supposed to toggle the control. |
|
The “for” attribute binds a label to another element. Set the value of the “for” attribute equal to the value of the “id” attribute of the related element. |
|
Format: |
<label for=”element_name”>Last Name:</label> |
|
Example: |
<label for=”name”>Last Name</label> |
|
Attributes: |
for defines the name of the element for which this label is made. |
|
Example |
Page in browser will look like |
<label for=”name”> Name</label>
<input type=”text” name=”name” id=”name” /> |
|
|
|
|
|