JSFiddle - React, Tailwind, and code Playground
HTML
<input value="111"> //similar
<input value="222">
<input value="111"> //similar
<input value="333">
JavaScript
var vals = {};
$('input').each(function() {
var index = $(this).val();
if (vals[index])
{
vals[index]++
}
else
{
vals[index] = 1;
}
});
var duplicates = $.map(vals, function(val, key){
return (val > 1) ? key : null;
});
if (duplicates.length > 0) alert('There are duplicates!');