jQuery - Select first cell of a given row?

后端 未结 2 619
悲哀的现实
悲哀的现实 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:40

    How about?

    var a = $('td:first', $(this).parents('tr')).text();
    

提交回复
热议问题