how to remove duplicate div sections?
<p>I am appending data output into this div section.</p>

<p>Within this <code>&lt;div&gt;</code> section, there are <code>&lt;div&gt;</code> sections that are duplicates. How can I remove the latter duplicates?</p>

<p>Example coding to remove:</p>

<pre><code>&lt;div id=EXTRACTION_a&gt;something ...&lt;/div&gt;
&lt;div id=EXTRACTION_b&gt;something ...&lt;/div&gt;
&lt;div id=EXTRACTION_c&gt;something ...&lt;/div&gt;
&lt;div id=EXTRACTION_a&gt;something ...&lt;/div&gt;
&lt;div id=EXTRACTION_b&gt;something ...&lt;/div&gt;
&lt;div id=EXTRACTION_a&gt;something ...&lt;/div&gt;
&lt;div id=EXTRACTION_c&gt;something ...&lt;/div&gt;
&lt;div id=EXTRACTION_d&gt;something ...&lt;/div&gt;
&lt;div id=EXTRACTION_a&gt;something ...&lt;/div&gt;
</code></pre>

<p>I want to keep the first occurances of a,b,c,d and remove the rest.</p>

<p>I tried this coding but not working:</p>

<pre><code>            var count = -1;
            \$("div[id^='EXTRACTION_']").each(function(){
               count ++;
               var ids = \$('[id='+this.id+']');
               var originaldivsectin = \$(this);

               var count2 = 0;
               \$("div[id^='EXTRACTION_']").each(function(){
                    count2 ++;
                    var copyids = \$('[id='+this.id+']');
                    var dupdivsection = \$(this);
                    if (count != count2 &amp;&amp; copyids.length&gt;1 &amp;&amp; ids[count]==copyids[count2])
                    {
                        dupdivsection.remove();   
                    }
               });

               // if(ids.length&gt;1 &amp;&amp; ids[0]==this)
               // {  
               //       \$(this).remove();
               //       alert('Multiple IDs #'+this.id);
               // }
            });
</code></pre>

<p>Note: jquery is still a new language for me</p>
