Accordion Jquery

PHOTO EMBED

Fri May 27 2022 04:58:14 GMT+0000 (UTC)

Saved by @jaysoni123 #jquery


$(document).ready(function() {
  jQuery('.accordion-list > li > .answer').hide();
  jQuery(".accordion-list > li:first-of-type").addClass("active");
  jQuery('.accordion-list > li.active').find(".answer").slideDown();
    $('.accordion-list li h2').on("click", function(){
        $('.accordion-list li h2').not(this).removeClass('active');
        $(this).next('.accordion-list > li > .answer').slideToggle();
        $(this).toggleClass('active');
        $('.accordion-list > li > .answer').not($(this).next()).slideUp(400);
    });
});
content_copyCOPY