[jQuery] Traversal: Aggressive "next" to blast through all parents?
Given HTML code like this:
<tr>
<td>
<input class="stop" name="main" id="main" value="Hello" />
<input name="loc" id="loc" />
</td>
</tr>
<tr>
<td>
<input name="dept" id="dept" />
<input class="stop" name="sub" id="sub" />
</td>
</tr>
I want some way to skip to each 'stop' class..something that crawls
forward, up and down parents and children, in other words:
var x = $('#main').crawl('.stop'); //
[startingPoint].crawl([stoppingPoint]);
Now x == $('#sub'). next() doesn't work because it just grabs the
next item. nextAll() and siblings() keep grabbing siblings until it
hits the end (a </tr>, </form>, etc..some sort of parent). I need a
way for it to keep traversing through ANYTHING until it hits what it's
looking for.
Is this possible? I have a feeling maybe slice() could be used
somehow, or filter().