Okay... how do I select a element's parent's child with specyfied class name..?
A:
$(this).parent("div").child(".className")
also, a parent element's child is technically a sibling of the current element, so you could try:
$(this).siblings(".className")
Jason
2009-07-30 21:52:15
next specifically looks at the next sibling - your second example won't work if the element with class .classname doesn't follow the original element immediately.
DDaviesBrackett
2009-07-30 21:55:46
true. fixed, thanks.
Jason
2009-07-30 21:58:44
parent only goes to the err parent so the filter is pretty useless unless you only want the parent if it is indeed a div. .closest() is a better choice if you want to search up until a match.
redsquare
2009-07-30 22:16:26
+5
A:
an "element's parent's child" is called a sibling:
$(this).siblings(".theClassYou'reAfter")
DDaviesBrackett
2009-07-30 21:54:04
A:
yeah... that is obvoius to me now. I just begin with jQuery and thanks to You the whole siblings/child/parent stuff is clear to me now. Thanks a lot! :)
If you feel one of the provided solutions answered your question, please Accept it rather than adding more answers =)
DDaviesBrackett
2009-08-04 16:18:49