How to add up values of checkboxes in real time using JQuery?
<p>Should be easy, but this code isn't working for me:</p>

<pre><code>$("#checkboxdiv input:checkbox").change(function() {
            var total = 0;
            $('#checkboxdiv input:checkbox:checked').each(function() {
                total += parseInt(this.value, 10);
            });
            $('#totalsdiv').text(total);
        });
</code></pre>

<p>The checkboxes to consider are all in the #checkbox div, and I'm trying to fill in the div with the total amount.</p>

<p>Thanks.</p>
