How do i prevent duplicate insertion from one table to another at client side using javascript -


this table code.the data gets inserted table table duplicates.i want insert rows without duplicates.do need use array , other javascript methods?

function onselect(code,name,phone) {      var newrow = document.all("listtable").insertrow(-1);      cell1 = newrow.insertcell(0);     cell1.innerhtml = code;      cell2 = newrow.insertcell(1);     cell2.innerhtml = name;      cell3 = newrow.insertcell(2);     cell3.innerhtml = phone;      cell4 = newrow.insertcell(3);     cell4.innerhtml = "<font onclick=\"removerow(this)\" style=\"color:red;cursor:pointer;\"> x </font>";  }