Jquery去表格重复行

    xiaoxiao2022-07-03  112

    //去重 var tableRows = $('#lythwzTable').find("tbody tr"); var seens = []; for(var i = 0; i < tableRows.length; i++) { var tRow = $(tableRows[i]); var cell1Content = tRow.find("td:last-child input").val(); console.log("cell1Content====>"+cell1Content); if(seens.indexOf(cell1Content) != -1) { tRow.remove(); } else { seens.push(cell1Content); } }

     

    最新回复(0)