dcsimg
Login | Register   
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


Tip of the Day
Language: Web
Expertise: Intermediate
Apr 26, 2000

WEBINAR:

On-Demand

Application Security Testing: An Integral Part of DevOps


Use the LABEL Tag to Associate Text With Intrinsic Controls

In the HTML 3.2 specification, there was no way for an author to associate text with an intrinsic control such as a radio button or text box. Unlike an <A> tag, which has an accompanying </A> tag and encloses text, the <INPUT> tag does not have an </INPUT> tag. Therefore, screen readers have a difficult time finding exactly which text to use to describe the control to the user.

HTML 4.0 introduces the LABEL tag, which allows the author to associate text with another HTML element. This is particularly useful for associating text with intrinsic controls. Whenever an intrinsic control is used on a page, a LABEL tag containing its associated text should accompany it. Doing so provides an additional benefit: clicking the label toggles the value of the associated intrinsic control. To associate a LABEL tag with a radio button, use the following HTML syntax:

 
<FORM>
<INPUT TYPE=radio ID=FirstButton NAME=radio1>
<LABEL FOR=FirstButton>I'm the text for the first radio button</LABEL><BR>
<INPUT TYPE=radio ID=SecondButton NAME=radio1>
<LABEL FOR=SecondButton>I'm the text for the second radio button</LABEL>
</FORM>
Manoj K.
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
×
We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.
Thanks for your registration, follow us on our social networks to keep up-to-date