title: Remove first of element pair with duplicate class. Classes have unique number for each pair
body: <p>I have a pair of items with same class id number and I would like to remove first item of the pair.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$('.itemid').each(function() {
  
      var currentclass = $.trim($(this).attr('class').replace('itemid', ''));
  
      if ($('.itemid.' + currentclass).length &gt; 1) {
          $(this).remove();
      }
      });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;div class="itemid 83"&gt;&lt;/div&gt;
  &lt;div class="itemid 83"&gt;&lt;/div&gt;
  
  &lt;div class="itemid 84"&gt;&lt;/div&gt;
  &lt;div class="itemid 84"&gt;&lt;/div&gt;
  
  &lt;div class="itemid 85"&gt;&lt;/div&gt;
  &lt;div class="itemid 85"&gt;&lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>It is working great with plain HTML, but I can't get it to work on a live site. Could it be because div contains a lot of content and sub divs?</p>
  
  <p>There are no jQuery errors and I can target items with a simple function like <code>.addClass</code> with no problems.</p>
  
  <p>Another thing that crossed my mind - item number itself (83, 84, 85, etc) is generated by php. But I can target <code>$('.itemid.83').addClass('test');</code> with no problems</p>
  
  <p>Maybe there is a better solution for this? </p>