I have this each() which collects all checked checkboxes with parameter data-is-rate = 1
$('input[data-is-rate="1"]:checked').each(function(){
console.log($(this).attr('data-id'));
});
From this, I'm getting every data-id
111
222
333
So is there any way to compare them? The IDs are not unique and can be the same and I need to check.
So if data-id recurs, it should return an error.
For example, if the output is like this, it should return an error.
111
222
111
If the output is like this, there should be no error because the values are unique
111
222
333
How can I compare these?