I have this table that is assembled by a PHP code (which I don't have access to) but it brings similar results and if I try to delete one of them it will erase all of the similar ones, which is not what I intend to. I want to delete all of the similar results on the table and leave just one.
The table is quite complex so I'll leave here just the tr contents, but when the id is equal to the previous one, all of th information inside the td is equal as well:
`
<table id=ms_evaluations>
<tr id="110732" role="row" class="odd"></tr>
<tr id="110732" role="row" class="odd"></tr>
<tr id="110732" role="row" class="odd"></tr>
<tr id="110321" role="row" class="odd"></tr>
<tr id="110321" role="row" class="odd"></tr>
<tr id="89021" role="row" class="odd"></tr>
<tr id="78901" role="row" class="odd"></tr>
</table>
`
I have tried to do something like this on javascript:
var ids =[];
$("#dt_evaluations").find("tr").each(function(){ ids.push(this.id); });
var repeated = [];
for(var i=0; i<=ids.length; i++){
var compare = ids[i];
var count = 0;
for(var x=0; x<=ids.length; x++){
var copy = ids[x];
if (x!=i && compare==copy && count==0){
repeated.push(copy);
count++
$($("#(repeated[0])")[0]).remove();
}
}
}
but it does not work. Does anybody knows how to solve this issue?