(function($) {
// more code using $ as alias to jQuery
$('.simplefaq-item .question').click(function() {
var parent = $(this).parent();
parent.children("div").slideToggle();
});
})(jQuery);
[/faq]
Simple! .simplefaq-item wraps the question and answer. The answer is an anchor tag. When the anchor tag is clicked, the script finds the parent and then toggles the child div, aka the answer.
Grab the script from GitHub: http://bit.ly/10a40yp
Want more? Sign up for my weekly newsletter