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);
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
$('#span1').bind('click', function() { return $(this).next(span); });
or
$('#span1').bind('click', function() { return $(~ span,this); });
~Sean
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
4 matches
Mail list logo