Jquery find duplicate emails -


I want to check the duplicate email in the list, so I get a list of emails and then not sure How to loop it to compare each email in the list.

  var email = $ ('td.emails input'); Emails.each (function (how to compare email here}};    

< P> You can use a hash to track uniqueness in javascript, this means an object; try it:
  var email = $ ('td.emails input '); Found found = {}; Emails.each (function () {var email = $ (this) .val (); if (found email) {// duplicate!} And (found [email] = true; }});    

Comments