1. Computing

Discuss in my forum

<label></label>

By , About.com Guide

<label> Description:

The <label></label> assigns an informative label to form controls (one label to one control).

<label> Web Browser Support:

<label> Attributes:

<label> End Tag:

</label> REQUIRED

<label> Contents:

Text CDATA. The following tags are valid within the <label> tag:
a, abbr, acronym, applet, b, basefont, bdo, big, br, button, cite, code, dfn, em, font, i, iframe, img, input kbd, label, map, object, q, s, samp, script, select, small, span, strike, strong, sub, sup, textarea, tt, u, var

<label> Valid Context:

The <label> tag is valid within the following tags:
form

<label> Usage:

  • Standard <label>
    <form>
     <label for="firstname">
     First Name:
     </label>
     <input type="text" name="firstname" id="firstname" />
     </form>
  • <label> surrounding the form element
    <form>
     <label>
     First Name: 
     <input type="text" name="firstname" />
     </label>
     </form>

<label> Special Notes:

  • If you place your label in one table cell and the control in another, you will need to use the for attribute to define the explicit control associated with the label.
  • The label can receive focus, with the onfocus attribute. When this happens, the focus is transferred to the associated control.
  • Labels are used by browser agents in different ways, including visually, read aloud, and so on. Be sure to test in several browsers so that it displays as you expect.

More <label> Information:

©2013 About.com. All rights reserved.