Reputation:
See http://jsfiddle.net/kzaRh/
Click on Renew
label, and checkbox will be selected. But if you click on checkbox input
, then Renew label will not work.
Upvotes: 0
Views: 81
Reputation: 5413
Why don't you just use a <label for="autoRenew">Renew</label>
? If you do, it will automatically take care of checking/un-checking the associated box.
Upvotes: 2
Reputation: 3175
Why using this way? That's the good practice:
<input id="autoRenew" type="checkbox" />
<label for="autoRenew">Renew</label>
No javascript required. Jsfiddle: http://jsfiddle.net/kzaRh/4/
Upvotes: 2