jQuery: Adding up multiple dynamic values
<p><strong>What I'm trying to achieve is this:</strong></p>

<p>I have multiple <em>td's</em> with the same class but different values.</p>

<pre><code>&lt;td class="goals_238"&gt; 3 &lt;/td&gt;
&lt;td class="goals_311"&gt; 0 &lt;/td&gt;
&lt;td class="goals_128"&gt; 1 &lt;/td&gt;
&lt;td class="goals_238"&gt; 4 &lt;/td&gt;
&lt;td class="goals_238"&gt; 3 &lt;/td&gt;
</code></pre>

<p>I want to get the values of "goals_238" and add them up.</p>

<p>The end result for "goals_238" would be = 10</p>

<p>This whole thing is for a sports results table, hence "goals" classes.</p>

<p>I can get to print how many times "goals_238" appears, but doing the math is whole other level for me.</p>

<pre><code>var gamesPlayed = ( $('.goals_238').length );
$('p#goals_238').html(gamesPlayed);
</code></pre>

<p>Any clues on how would I go about this? </p>
