Name
label — <label> . . . </label>
Used to attach information to controls. Each label
element is associated with exactly
one form control. The label
element may contain the form control, or it may use the for
attribute to identify the control by
its id
value.
Attributes
Core,Internationalization,Events, Focus
for="
text
"
Explicitly associates the label with the control by matching the value of the
for
attribute with the value of theid
attribute within the control element.
Examples
<label>
No thanks <input name"list" value="no" /></label>
<label for="lastname">
Last Name:</label>
<input type="text"id="lastname"
size="32" />
Get HTML and XHTML Pocket Reference, 3rd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.