更新时间:2023-02-26 15:07:07
阅读此帖子:此
基于帖子,这是一个示例:
Based on the post this is an example:
function removeD(w){
var seen = {};
if(w == 'val'){
$('table tr td').each(function() {
var txt = $(this).text();
if (seen[txt])
$(this).remove();
else
seen[txt] = true;
});
}else{
$('table tr td').each(function() {
var id = $(this).attr('id');
if (seen[id])
$(this).remove();
else
seen[id] = true;
});
}
}
$('#removeID').click(function(){
removeD('id');
});
$('#removeVal').click(function(){
removeD('val');
});