所以我有个密码:
<input type=checkbox class="checkbox" />
<input type=checkbox class="checkbox" />
<input type=checkbox class="checkbox" />
<input type=checkbox class="checkbox" />
<div class="number">
hello
</div>JS
var increment2 = 1;
$('.checkbox').live('click', function() {
$('.number').html( '(' + increment2 + ')');
increment2++;
})http://jsfiddle.net/P3zMu/5/
当单击复选框时,它会增加数字,如本例所示。问题是在选中复选框时增加数字,在未选中复选框时减少。对于任何帮助都将是非常好的。
https://stackoverflow.com/questions/8728574
复制相似问题