Conside below html -
3条回答 北荒 (楼主) 2021-02-14 06:21 To get the first parent personally I use the following construction: var count_parents = $(".element").parents().length; $(".element").parents().eq(count_parents - 1); Hope, it will be helpful for someone. 0 讨论(0) 查看其它3个回答 发布评论: 提交评论 加载中... 验证码 看不清? 提交回复 热议问题
To get the first parent personally I use the following construction:
var count_parents = $(".element").parents().length; $(".element").parents().eq(count_parents - 1);
Hope, it will be helpful for someone.