我有以下的html。它的表可以包含许多行id = rows_x。jQuery从类元素中重命名为
<div class="row_table" id="row_1">
<div class="row_table" id="row_2">
<div class="row_table" id="row_3">
<div class="row_table" id="row_4">
然后,我有ID按钮,一旦点击会删除ID = “row_2”
$("#button").click(function(){
$('#row_2').remove();
/* Rename rows id goes here */
}
现在我的问题:
由于row_2已被删除,我需要能够重命名所有后续行。
row_3应该成为row_2等..
我可以问你为什么这么做? (这些ID的目的是什么?) – meo