You did right, another way to do that could be
$(this).addClass("selected").parent().siblings().children('a').removeClass('selected');
solved JQuery Class Toggle [closed]
You did right, another way to do that could be
$(this).addClass("selected").parent().siblings().children('a').removeClass('selected');
solved JQuery Class Toggle [closed]