Developing Webs logo
Google
Web DW-Main DW-Photoshop
Visit the message board for solutions or post a question Check out the Classes offered for free at Developing Webs Voice Chat submit a tutorial, resources, article, font for publication consideration and earn a one way link back to your site Get more specifics about the Developing Webs Voice chat room and its room members View the current news at Developing Webs alternative sites which are resources for your d3evelopment needs Join Developing Webs Chat Link to us on your web page to help support this resource! Check out Developing Webs At yahoo groups! Developing Webs Home Adobe Photoshop Tutorials Macromedia Flash Tutorials Jasc Paint Shop Pro Tutorials Adobe Illustrator Animation basics Some Basic PHP tutorials Perl Tutorials HTML Tutorials Cascading Style Sheets javascript Front Page Tutorials Macromedia Dream Weaver Tutorials dreamweaver Publishing your site, FTP, ChMod, Promotions Tools to help you create your site Free and shareware fonts to download Photographs to use in your projects Shop for your site needs Free Online classes REcommend this site to others Log in or edit your information when logged in Developingwebs Log Out Change My Account details and preferences
RSS Newsfeed
for your site
DW News
Calendar
DW Forum
Right click on button and copy shortcut

Add to My Yahoo!

Reminder
Remember to book mark this site!



Request a Tutorial

 

<LABEL> ... LABEL

Description:

The non-nestable LABEL element accomplishes two tasks: association of a description with a form field control and increasing the size of the active user interface region for selecting the form control. Description attachment is of greatest use to speech-based browsers, while the benefits of an increased user interface region are felt most by users of browsers that accommodate a pointing device (such as a mouse or pen.) Activating a LABEL with a pointing device passes input focus on to its associated form field control.

Labels are attached either explicitly or implicitly. Explicit attachment is accomplished through the use of a form field ID as the value of the FOR attribute. This method allows attachment of a LABEL to a field elsewhere in the document and has the advantage of allowing multiple LABELs to be attached to a single form field.

Form fields are attached implicitly to a LABEL when they are in the contents of the LABEL element. In this case, the LABEL must only contain one form field within the LABEL contents.

Attributes:

accesskey - This is a method of giving access/focus to an active HTML element using a keyboard character. This is a common GUI paradigm also known as a "keyboard shortcut" or "keyboard accelerator" A single character is used as the value of this attribute. In addition, a platform-dependent key is usually used in combination with the ACCESSKEY character to access the functionality of the active field.

for - This attribute identifies which form field the LABEL is attached to. If this attribute is not used, the LABEL is associated with its contents.

onblur - A blur Event Handler executes script code when a hyperlink loses focus.

onfocus - A focus Event Handler executes script code when a hyperlink receives focus by tabbing with the keyboard or clicking with the mouse.

Example code:

<fieldset>
<legend ACCESSKEY=G TABINDEX=1>Gender</legend>
<label ACCESSKEY=M><input TYPE=RADIO NAME=Gender VALUE=Male>
Male</label> <br> 
<label ACCESSKEY=F><input TYPE=RADIO NAME=Gender VALUE=Female>
Female</label>
</fieldset> 

Result:

Gender





"Building The Web Into a Nicer Place -- One Site At A Time"
Developing Webs Group Copyright © 2001-2008 All Rights Reserved
Privacy and Legal