[jQuery] Re: Getting the next span

2007-07-10 Thread jmbJq
Thanks Sean, I ended up using the second one as a basis. Here's what I ended up with: $(~ span:first, this); This gives me the single next span, just like I wanted. On Jul 9, 9:12 pm, Sean Catchpole [EMAIL PROTECTED] wrote: $('#span1').bind('click', function() { return $(this).next(span);

[jQuery] Re: Getting the next span

2007-07-09 Thread Glen Lipka
Did you try next(span)? Glen On 7/9/07, jmbJq [EMAIL PROTECTED] wrote: Been using jQuery for a while, but can't seem to figure this one out. What I want to do is get the next span element when someone clicks on the text inside the first span element. Then when someone clicks on the text in

[jQuery] Re: Getting the next span

2007-07-09 Thread Sean Catchpole
$('#span1').bind('click', function() { return $(this).next(span); }); or $('#span1').bind('click', function() { return $(~ span,this); }); ~Sean

[jQuery] Re: Getting the next span

2007-07-09 Thread Eric Crull
I use this logic to get the next input, and to search for the next input if there were intervening elements, for example: divinput/div div table trtd//tdtd/td/tr trtd/tdtdinput/td/tr /table /div The function will iterate through until it finds the next input, even if it is not