(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
I'm available for one-on-one consulting calls – click here to book a meeting with me 🗓️
Want more? Sign up for my weekly newsletter