Click Label to Access Form Control

1.Using the label element allows the user to click on the text associated with the form control instead of having to click the radio button, check box, select box, etc.

2.To associate a label with another control implicitly, the control element must be within the contents of the Label element. In this case, the Label may only contain one control element. The label itself may be positioned before or after the associated control.

Example:-

<html>
<body>
// For Radio Button
<label for=”radio1″>Radio Button – Click this Label</label>
<input type=”radio” value=”Selected” name=”Radio” id=”radio1″>
// For CheckBox
<label for=”check”>Checkbox – Click this Label</label>
<input type=”checkbox” value=”Selected” name=”check” id=”check”>
</body>
</html>

Demo Link

Popularity: 8% [?]

Related posts:

  1. How to Embed a Flash File into C# Window Form?
  2. Split Function in Javascript
  3. Disable Right Mouse Click Using JavaScript
You can leave a response, or trackback from your own site.

Leave a Reply

Designed by: Business Web Hosting | Thanks to Buy Icons, travel tips and Used Cars