So if I had an input element in a certain div and another input element in that same div, is there a way I could reference that second input element from a $(this) that came from a change event of the first input element? This way I could have an infinite number of possible divs but each change would only effect the second element of that is sharing the div with the first element (which called the change event)?
views:
30answers:
2
+4
A:
$(this).next('input')
or if it's before:
$(this).prev('input')
or if you're not sure:
$(this).siblings('input')
John Rasch
2009-09-17 15:00:41
Ah sorry, I posted siblings before you edited. I'll delete mine and +1.
Alex Barrett
2009-09-17 15:03:19
Also .nextAll('input') and .prevAll('input')
R. Bemrose
2009-09-17 15:05:48