HTML <LABEL ...>

  • FOR: form element for which this is a label

<LABEL ...>, an HTML 4.0 element supported by MSIE and Netscape 6, defines a set of text that is associated with a particular form element. For example, this code indicates that the phrase "send more information" is associated with the moreinfo checkbox because the checkbox is within the <LABEL ...> element:

This Code Makes This
<LABEL FOR="moreinfo">
send more information 
<INPUT NAME="moreinfo" TYPE=CHECKBOXID="moreinfo">
</LABEL>
(Form is not live)

The FOR attribute is required. The value of FOR should be the same as the value of ID in the form field that the label applies to.

You can also associate a <LABEL ...> with a field that is not within its contents. See the FOR attribute.

<LABEL FOR="..."> >