I have encountered an issue with my Accordion code. When I test it, the word 'not' is displayed twice, while 'hve' is not displayed at all.
$('.st-accordion li a').click(function() {
if ($(this).parent().not('activeaccordion')) {
$(this).parent().addClass('activeaccordion')
alert('not');
$(this).next().slideToggle();
} else {
if ($(this).parent().hasClass('activeaccordion')) {
alert('hve');
$(this).parent().removeClass('activeaccordion')
$(this).next().slideToggle();
}
}
});