Syntax
<LABEL>...</LABEL>
Attribute Specifications
FOR=IDREF (associated form field)
ACCESSKEY=Character (shortcut key)
ONFOCUS=Script (element received focus)
ONBLUR=Script (element lost focus)
common attributes
Contents:
Inline elements except LABEL
Contained in:
Block-level elements, Inline elements except BUTTON
<TABLE>
<TR>
<TD>
<LABEL FOR=user ACCESSKEY=U>User</LABEL>
</TD>
<TD>
<SELECT NAME=user ID=user>
<OPTION>Simon</OPTION>
<OPTION>Andrew</OPTION>
<OPTION>Claire</OPTION>
<OPTION>Julia</OPTION>
</SELECT>
</TD>
</TR>
<TR>
<TD><LABEL FOR=passwd ACCESSKEY=P>Password</LABEL></TD>
<TD><INPUT TYPE=password NAME=password ID=passwd></TD>
</TR>
</TABLE>
<P>
<LABEL ACCESSKEY=S>
<INPUT TYPE=checkbox NAME=save VALUE=yes>
Save user name and password in a cookie
</LABEL>
</P>
<P>
<LABEL ACCESSKEY=C>
Comments to post:
<TEXTAREA NAME=comments ROWS=8 COLS=50></TEXTAREA>
</LABEL>
</P>
|
The ACCESSKEY attribute, used throughout the preceding example, specifies a single Unicode character as a shortcut key for giving focus to the LABEL, which passes the focus on to the associated form control. Entities (e.g. é) may be used as the ACCESSKEY value. The LABEL element also takes a number of attributes to specify client-side scripting actions for various events. In addition to the core events common to most elements, LABEL accepts the following event attributes:
ONFOCUS, when the element receives focus; |