Jquery add up values on click
<p>I have a problem with adding up values when on click function is performed.</p>

<p>I have simple radio buttons:</p>

<pre><code>&lt;input type="radio" name="product1" class="price" value="4" /&gt; 4
&lt;input type="radio" name="product2" class="price" value="6" /&gt; 6
</code></pre>

<p>I would like to add up values when click is performed. Obviously I can get values on click but I don't know how to add them up.</p>

<pre><code>$('.price').click(function() {
    price = $(this).val();
}
</code></pre>

<p>OK, other issue.</p>

<p>What if we have two separate click functions like this:</p>

<pre><code>&lt;input type="radio" name="product1" class="price" value="4" /&gt; 4
&lt;input type="radio" name="product2" class="price" value="6" /&gt; 6

&lt;input type="radio" name="product1" class="number" value="3" /&gt; 3
&lt;input type="radio" name="product2" class="number" value="7" /&gt; 7
</code></pre>

<p>and</p>

<pre><code>$('.price').click(function() {
    price = $(this).val();
}

$('.number').click(function() {
    number = $(this).val();
}
</code></pre>

<p>How to add up values from .price radio and .number radio?
On top of that make sure you can only add one value from each, not that it will be adding all values regardless of which group of radio buttons?</p>
