Witam mam problem robię stronę internetową i mam taki skrypt
$(document).ready(function(){
$('.Closed').click(function(){
$('.DropDownMenuUpperItem').children('a').children('i').addClass('fa-sort-down');
$('.DropDownMenuUpperItem').children('a').children('i').removeClass('fa-sort-up');
$('.DropDownMenuUpperItem').addClass('Closed')
$('.DropDownMenuUpperItem').removeClass('Opened')
$(this).children('a').children('i').addClass('fa-sort-up');
$(this).children('a').children('i').removeClass('fa-sort-down');
$(this).addClass('Opened')
$(this).removeClass('Closed')
});
})
$(document).ready(function(){
$('.Opened').click(function(){
$('.DropDownMenuUpperItem').children('a').children('i').addClass('fa-sort-down');
$('.DropDownMenuUpperItem').children('a').children('i').removeClass('fa-sort-up');
$(this).removeClass('Opened')
$(this).addClass('Closed')
})
})
I chcem zrobić aby po kliknieciu w element <a> nadawał on klasę rodzicowi {klasa Opened} i zmieniał klasę ikonie która jest w środku tego elementu oraz aby usuwał on klase Opened innym elemntom jeżeli oczywiście takie coś istnieje