0

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.

0

2 Answers 2

2

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/

Sign up to request clarification or add additional context in comments.

Comments

2

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.