jQuery - Select first cell of a given row?

后端 未结 2 580
悲哀的现实
悲哀的现实 2021-02-05 00:59

I have a table with images in one column. When I click the image, would like to get the text value of the first column in that row.

I can get the whole row with this:<

2条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-05 01:51

    Here's another option:

    var a = $(this).closest('tr').find('td:first').text();
    

提交回复
热议问题