W3 3.2n
4.0y
NS 3.0n
4.0n
IE 3.0n
4.0n
TV 1.2n
2.1n

<LABEL>...</LABEL>

Description

Attach information to a specific field of a form. It is possible to attach more than one label to a field.

DTD

<!ELEMENT LABEL - - (%inline;)* -(LABEL) -- form field label text -->
<!ATTLIST LABEL
  %attrs;                              -- %coreattrs, %i18n, %events --
  for         IDREF          #IMPLIED  -- matches field ID value --
  accesskey   %Character;    #IMPLIED  -- accessibility key character --
  onfocus     %Script;       #IMPLIED  -- the element got the focus --
  onblur      %Script;       #IMPLIED  -- the element lost the focus --
  >
from the HTML 4.0 DTD, "Copyright © W3C, (MIT, INRIA, Keio). All Rights Reserved."

Attributes

Core attributes: class id style title
Internationalization attributes: dir lang
Events: onclick ondblclick onmousedown onmouseup onmouseover onmousemove onmouseout onkeypress onkeydown onkeyup

W3 3.2n
4.0y
NS 3.0n
4.0n
IE 3.0n
4.0n
TV 1.2n
2.1n
ACCESSKEY
Description of the accesskey attribute
W3 3.2n
4.0y
NS 3.0n
4.0n
IE 3.0n
4.0n
TV 1.2n
2.1n
FOR
This attribute attaches the label to a specific field in the form. The value for this attribute must be the same as the value of the id attribute for the field that is being attached.
W3 3.2n
4.0y
NS 3.0n
4.0n
IE 3.0n
4.0n
TV 1.2n
2.1n
ONBLUR
Description of the ONBLUR attribute
W3 3.2n
4.0y
NS 3.0n
4.0n
IE 3.0n
4.0n
TV 1.2n
2.1n
ONFOCUS
Description of the ONFOCUS attribute

Examples

Source
<FORM>
<LABEL for="name">Name</LABEL>
<LABEL for="address">Address</LABEL>
<LABEL for="city">City</LABEL>
<LABEL for="country">Country</LABEL>
<INPUT type="text" name="name"><BR>
<INPUT type="text" name="address"><BR>
<INPUT type="text" name="city"><BR>
<INPUT type="text" name="country">
</FORM>
 
Result



Statistics