Add duplicate elements?
<p>Is this possible to do using jQuery?</p>

<p>Lets say I have a list of items, with values attached eg:</p>

<ol>
<li>Item1: 5</li>
<li>Item2: 10</li>
<li>Item3: 20</li>
<li>Item2: 15</li>
<li>Item4: 30</li>
<li>Item2: 25</li>
<li>Item1: 11</li>
</ol>

<p>How would I remove all duplicates and add the integers from removed duplicates to one entry, with an output as such using jQuery:</p>

<ol>
<li>Item1: 16</li>
<li>Item2: 50</li>
<li>Item3: 20</li>
<li>Item4: 30</li>
</ol>

<p>Edit: I've found a function to remove duplicates using $.each, but I have no idea where to go from here to store the values per iteration and modify the DOM for the original item.</p>

<pre><code>var seen = {};
$('.variety_name').each(function() {
    var txt = $(this).text();
    if (seen[txt])
        $(this).parent().remove();
    else
        seen[txt] = true;
});
</code></pre>
