I’m having some checkboxes, where all have different values but all numbers.
I want to get the values that are checked, and then add the numbers together and then display the result in my div.
<div id="pakker">
<input type="checkbox" value="39" />test 1<br/>
<input type="checkbox" value="79" />test 2<br/>
<input type="checkbox" value="29" />test 3<br/>
<input type="checkbox" value="49" />test 4<br/>
ect
</div>
What I have so far is this: var pakker = $('#pakker checkbox:checked').val();
UPDATE:
Where i want the result: <h1 id="sk">0</h1>
But it’s not really working, although I’m not getting any errors.
Does anyone know how this can be done, as easily as possible?
Here you can see what to do: http://jsfiddle.net/vaKWs/6/
Updated to sum values automatically.