/ Published in: jQuery
jQuery - Page Component - Accordion
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
$('.accordion div.tab').on('click', function() { $(this).next().slideToggle(); }); $(".accordion div.tab a").on('click', function() { if ($(this).attr("class") == "active") $(this).removeClass("active"); else $(this).addClass("active"); });