开发者

jQuery. Checkbox problem

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.


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/


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜