I want to find the nth parent element of an given element and access the attributes of parent.
4条回答 谎友^ (楼主) 2020-12-24 11:26 You could make a little plugin to take care of that: $.fn.nthParent = function(n){ var p = this; for(var i=0;i and then use it as: $('#element1').nthParent(3); 0 讨论(0) 查看其它4个回答 发布评论: 提交评论 加载中... 验证码 看不清? 提交回复
You could make a little plugin to take care of that:
$.fn.nthParent = function(n){ var p = this; for(var i=0;i
and then use it as:
$('#element1').nthParent(3);