Jquery- Get the value of first td in table

后端 未结 6 2421
旧巷少年郎
旧巷少年郎 2020-12-03 02:51

I am trying to get the value of first td in each tr when a users clicks \"click\".

The result below will output aa ,ee or ii. I was thinking about using closest(\'t

6条回答
  •  甜味超标
    2020-12-03 03:07

    In the specific case above, you could do parent/child juggling.

    $(this).parents("tr").children("td:first").text()
    

提交回复
热议问题