jQuery for this parent's next sibling's 3rd child.
Posted: Tue Aug 30, 2011 2:08 am
Hello fellows, I'm a relative newbie at jQuery which I started learning as an alternative to JavaScript and all its annoying cross browser incompartibility issues. Well I'm trying to create selectors for a current element's distant relative for example, I need a constructor for an element's parent's next sibling's second child. Well here's what I came up with
I wonder if that makes any sense at all. I'm hoping it does. If not, who can show me how to construct this selector. Also what if I wanted to make things a little bit murkier for example, what if I wanted a constructor for this element's parent's 3rd next sibling's second child? Can someone please show me how to do that?
Code: Select all
$(this).parent().next().children().get(1)
I wonder if that makes any sense at all. I'm hoping it does. If not, who can show me how to construct this selector. Also what if I wanted to make things a little bit murkier for example, what if I wanted a constructor for this element's parent's 3rd next sibling's second child? Can someone please show me how to do that?