title: compare two values running in each loop jquery
body: <p>I am storing colon separated values in the data attributes of html elements</p>
  
  <pre><code>&lt;a class='te' data-tes='test123;123test;234test'&gt;test&lt;/a&gt;
  &lt;a class='te' data-tes='t3;1st;123test'&gt;test1&lt;/a&gt;
  </code></pre>
  
  <p>I would like a function that returns the common values. In the example above only <code>123test</code> would match. So far this is what I have tried</p>
  
  <pre><code>$('.te').each(function(){
      if($(this).data('tes')!= undefined){
          # Here how can i perform the comparision.
      }
  })
  </code></pre>