开发者

Does an alternative to .closest() exist?

this is a snippet from my code:

$("#myid").append($("p:contains('text')").closest("div").clone());

I tried to get the first closest ancestor div-element of p containing 'text'.

I开发者_开发技巧'm looking for an alternative to .closest() because I have to use jquery version 1.2.6. Do you have got an idea what I'm looking for?

I hope you can help me. I appreciate every hint, piece of code, etc..


$('p').parents('div:first')

should do :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜