remove table row with specific id

后端 未结 9 1191
时光取名叫无心
时光取名叫无心 2021-02-05 01:16

I have the following table:


 &l         
9条回答
  •  礼貌的吻别
    2021-02-05 01:44

    ID attributes cannot start with a number and they should be unique. In any case, you can use :eq() to select a specific row using a 0-based integer:

    // Remove the third row
    $("#test tr:eq(2)").remove();
    

    Alternatively, rewrite your HTML so that it's valid:

bla
bla
bla
bla
bla
bla

And remove it referencing just the id:

$("#test3").remove();

提交回复
热议问题