Jquery- Get the value of first td in table

后端 未结 6 2422
旧巷少年郎
旧巷少年郎 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:11

    $(this).parent().siblings(":first").text()
    

    parent gives you the around the link,

    siblings gives all the tags in that ,

    :first gives the first matched element in the set.

    text() gives the contents of the tag.

提交回复
热议问题