So I have this code:
HTML
<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++;
})
It increments the number when checkbox is clicked, as can be seen in the example. The issue is to increase the number when checkbox is checked and decrease when the checkbox is unchecked. Will be very greatful for any help.
Hi that’s your solution: https://jsfiddle.net/P3zMu/254/
HTML
JS
Best regards!