jQuery sum input values of each divs? : <p>I'm looking for a way to create a sum of inputs within an element. </p>

<p>I'm running into this problem that whenever I'm using each, the function itself sums all values and not just those within the div. </p>

<p>Working with this isn't working as hoped:</p>

<pre><code>$('div').each(function(){
    var sum = 0;

    $(this).find('input').each(function(){
        sum += Number($(this).val());
        });

        $('.sum').val(sum);

});
</code></pre>

<p>home someone can help:</p>

<p><a href="http://jsfiddle.net/1keyup/q7rL2a38" rel="nofollow noreferrer">http://jsfiddle.net/1keyup/q7rL2a38</a></p>
