jQuery- Toggle Up and Dowm

HTML:
 

Click 1

Click 2

SCRIPT:
 
jQuery(document).ready(function() {
    jQuery('#faq-list h2').click(function() {
       jQuery(this).next('.answer').slideToggle(500);
       jQuery(this).toggleClass('close');
       
    });
}); // end ready
Important: Please make sure, jQuery library is included in the page.

No comments:

Post a Comment