title: How to show error message for last duplicate value
body: <p>I want to show error message for last duplicate value in a table using jquery.table value i am adding dynamicaly.So how do it?. please share your ideas to resolve this issue.</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>$(document).ready(function() {
    $("#btnSave").click(function() {
      var arr = [];
      var tblid = $("#comp tr");
      tblid.each(function() {
        arr.push($(this).find('td').find('span').attr('data-id'));
      });
      alert(arr);
    });
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;table id="comp"&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;span data-id="kiste"&gt;&lt;/span&gt;kiste
        &lt;p class="close"&gt;
          Same Name so please change
        &lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;span data-id="Futiste"&gt;&lt;/span&gt;Futiste
        &lt;p class="close"&gt;
          Same Name so please change
        &lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;span data-id="kavi"&gt;&lt;/span&gt;kavi
        &lt;p class="close"&gt;
          Same Name so please change
        &lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;span data-id="kiste"&gt;&lt;/span&gt;kiste
        &lt;p class="close"&gt;
          Same Name so please change
        &lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;span data-id="Futter"&gt;&lt;/span&gt;Futter
        &lt;p class="close"&gt;
          Same Name so please change
        &lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/table&gt;
  
  &lt;button id="btnSave"&gt;Save Click&lt;/button&gt;</code></pre>
  </div>
  </div>
  </p>