在删除任何 HTML 表的行后,我正在使用以下代码来保持序列号与序列一致。
$("#trid_"+a_href).remove();
$("tr").each(function (index) {
if(index != 0) {
$(this).find("td:first").html(index + "");
}
});
该代码工作正常,但问题是它显示表中所有行的序列号。但我只想显示在<tr class="products">
我的猜测是,要解决这个问题我必须找到class="products"
in tr,所以我尝试了以下代码,但这次代码根本不起作用。
$("#trid_"+a_href).remove();
$(".products tr").each(function (index) {
if(index != 0) {
$(this).find("td:first").html(index + "");
}
});
你能帮我解决这个问题吗?谢谢
编辑
我的整个代码太大了。所以我在这里上传了脚本
谢谢 :)