Reputation: 21
say i have the following three options and each with a radio button beside
I need jQuery that when the user clicks on the word the radio button selects!
Upvotes: 2
Views: 64
Reputation: 12703
You can use the label tag:
<input id="emptyacct" type="radio" name="account" value="radiobutton" />
<label for="emptyacct">Yes </label>
Upvotes: 1
Reputation: 87073
Two ways:
<label for="london"><input type="radio" id="london"> London</label>
.Use label
's for
attribute similar to radio
's id
.
<label><input type="radio" > London</label>
Place the radio
within label
.
Very basic HTML
.
Upvotes: 1
Reputation: 108500
This is a built-in feature in HTML, so no need for JavaScript. Simply use the label
tag like this:
<label><input type="radio"> London</label>
<label><input type="radio"> New York</label>
<label><input type="radio"> Dubai</label>
Upvotes: 1
Reputation: 897
It's just HTML ;)
<input id="input_london" type="radio" name="london" value="radiobutton" />
<label for="input_london">London</label>
<input id="input_ny" type="radio" name="ny" value="radiobutton" />
<label for="input_ny">New York</label>
...
Upvotes: 0