I am trying to find the parent of an element and it\'s parent first child, the code is like this:
- &l
If you go up two levels, then find the next child, you're only going down one level -- you're setting the selected
class on the , not the
below it.. You need to go down another level. So it should be:
$('.selected').parent().parent().children(':first-child').children().addClass('selected');
Another way to get there is:
$('.selected').parent().siblings(':first-child').children().addClass('selected');