get row by index

前端 未结 9 944
名媛妹妹
名媛妹妹 2020-12-17 16:35

how can you get a row by the index?

var rows = $(\'tr\', tbl);
rows.index(0).addClass(\'my_class\');
9条回答
  •  臣服心动
    2020-12-17 17:29

    For the first element (index 0) the answer provided to your earlier question should be fine.

    For any nth element use eq selector

    e.g:

    var rows = $('tr:eq(8)', tbl);
    

提交回复
热议问题