|
Using the label tag can help assistive technology know precisely which text belongs to which form element. For instance, JAWS often correctly determines text in one column of a table as being associated with the form elements in the other column. Labeling it takes away all guesswork. Additionally using the label tag with form elements such as checkboxes and radio buttons makes the corresponding text clickable and thus easier for everyone to use. The Label Tag's AttributeSetting the "for" attribute of the label tag to correspond to the "id" attribute of the form element links the two objects together. ExampleThe following checkboxes do not have labels associated with them. Attempt to select the checkboxes by clicking the text. Jeopardy! Here's the HTML <p><input type="checkbox" id="jeopDummy" />Jeopardy!<br /> Now try clicking the text to select these checkboxes, which have associated labels.
Here's the HTML <p><input type="checkbox" id="jeop" /><label for="jeop">Jeopardy!</label><br /> NotesI have used JAWS 5.0 and later to develop these instructions; if you have an older version these instructions may or may not be accurate. Checkboxes are not the only form element that can make use of the label tag. WebsitesFreedom Scientific: www.FreedomScientific.com Felgall Internet - Displaying HTML Source Code in Web Pages: www.felgall.com/htmlt47.htm Author ContactPlease direct any questions, comments, thoughts, suggestions or corrections to the author at Jake@JBrownell.com DisclaimerAll Scripts, Tips and Tricks are provided on an "AS IS" basis without any implied garrentee. User assumes all responsibility for management of his or her software and its associated components. All trademarks, brands, product ids, etc. mentioned belong to either Freedom Scientific or their respective owners, no claim of ownership is made. Copyright 2005 J. A. Brownell Last Updated July 27, 2005 |