$('.faq__tab:first').addClass('active');
$('.faq__tab').click(function (e) {
e.preventDefault();
$('.faq__tab').not(this).removeClass('active');
$('.faq__content').not($(this).next()).slideUp();
$(this).toggleClass('active');
$(this).find('.icon').toggleClass('icon-up icon-down');
$(this).next().slideToggle();
});
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter