jQuery parent of a parent

前端 未结 9 1571
执笔经年
执笔经年 2020-12-02 05:40

I am currently trying to find the parent of a parent of an element. I have a link being clicked that is in a , and I\'d like to get the

9条回答
  •  北荒
    北荒 (楼主)
    2020-12-02 06:14

    Try wrapping the $(this).parent() into an jQuery object like $($(this).parent()) I often find the need to do this to make sure I have a valid jquery object. From there you should be able to get a hold of the parents parent, or using the prev() perhaps.

提交回复
热议问题