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 :)
精彩评论