<LABEL>
Defines a text label to associate with an input control for a web form.
The LABEL element is intended to be used with input controls that do not
have a default method of displaying a label.
You may associate more than one label with a single input control by creating
multiple references via the for attribute.
Attributes
Attribute |
Description |
ID |
Identifies this tag to reference in script (program code) |
CLASS |
Define the class used to render this element (defined by a style sheet) |
TITLE |
A title that is associated with the element (displayed as a tooltip in Internet Explorer) |
FOR |
References the ID of the input control this label should be associated with. |
|
Example
<FORM METHOD="post" ACTION="testlabel.php">
<TABLE>
<TR>
<TD><LABEL FOR="fname">First Name</LABEL>
<TD><INPUT TYPE="text" NAME="firstname" ID="fname">
<TR>
<TD><LABEL FOR="lname">Last Name</LABEL>
<TD><INPUT TYPE="text" NAME="lastname" ID="lname">
</TABLE>
</FORM>
Renders As:
Compatibility
HTML 4.01
|