title: Get unique values from list and create check box in jquery
body: <p>I need to create checkboxes from unique values of list, I am getting all values instead of unique values if i give class name as item name its working fine </p>
  
  <p>Here is my code </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var html = '';
  $('.bob').each(function() {
    var item = $(this).data('xyz');
    if (!$('input.' + item).length)
      $('.checkboxes').append('&lt;label&gt;&lt;input class="testclss"  data-var="' + item + '" type="checkbox" /&gt;' + item + '&lt;/label&gt;');
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;div class="bob" data-xyz="fish"&gt;&lt;/div&gt;
  &lt;div class="bob" data-xyz="dog"&gt;&lt;/div&gt;
  &lt;div class="bob" data-xyz="fish"&gt;&lt;/div&gt;
  &lt;div class="bob" data-xyz="cat"&gt;&lt;/div&gt;
  &lt;div class="bob" data-xyz="fish"&gt;&lt;/div&gt;
  &lt;div class="bob" data-xyz="fish"&gt;&lt;/div&gt;
  
  &lt;div class="checkboxes"&gt;&lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>