Hmm. So you want it to grab only the last element found? Why not a straight simple $('.gotme') selector?
In case you actually want all elements *between* those two, what would be the expected behavior for parents? Say you have this: <div id="start-here"></div> <ul> <li>something</li> <li>somethingelse</li> </ul> <div id="end-here"></div> $('#start-here').crawl('#end-here') should return what: <div>,<ul>,<li>,<li>,<div>? <div>,<ul>,<div>? or <div>,<li>,<li>,<div>? It's quite a confusing idea, what is the purpose of it? cheers, - ricardo On Nov 11, 8:15 pm, Sam H <[EMAIL PROTECTED]> wrote: > Sorry - but your script causes an infinite loop for some reason. And > jQuery's "nextUntil" doesn't work either, it doesn't survive past the > end of the sibling tree. > > I need my function to go PAST the end of the list of siblings, up > through parents, etc., all the way to the end of the document if need > be. > > Example: > > <body> > <div id="main">Text here - <div id="bury">buried</div> <div > id="lastKid">ends here</div></div> <!-- end main --> > <div id="gotme">got me!</div> > </body> > > $('.bury').crawl('.gotme') should actually return the "gotme" DIV. > next(), nextAll(), and nextUntil() will all stop right after the > "lastKid" DIV.