Friday, 22 August 2008

HTML labels

HTML labels can be placed next to form controls as an indication of what they represent so the user has an idea of their expecated value(s). They can also be linked to an individual control using the for attribute. This means that when the user clicks on the label, the focus of the page will be set to the respective control.
<label for="name">
<input type="textbox" name="name" id="name" />

Clicking on the label will set the focus to the input box.


No comments: