Getting a parent element for a jquery selector

后端 未结 3 1732
轻奢々
轻奢々 2020-12-10 10:25

I have a table where each row has a CSS id like this:

........         
3条回答
  •  独厮守ぢ
    2020-12-10 10:27

    you can use this.

    $('.anotherclass').click(function () {
         alert($(this).parents('tr').attr("id"));
    });
    

提交回复
热议问题