Does an alternative to .closest() exist?

javascript, jquery

Solution

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

should do :)

Problem

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..

Original source