Here is my jQuery
jQuery(document).ready(function($) {
$("#accordion").find(".accordion-toggle").click(function(){
$(this).next().slideToggle("fast");
$(".accordion-content").not($(this).next()).slideUp("fast");
});
});
Here is my html
<div id="accordion">
<header class="accordion-toggle">
<h2>Accordion Title <span id="accordionIcon">▼</span></h2>
</header>
<section class="entry accordion-content">
<p>Accordion Content</p>
</section>
</div>
Each time you press the new accordion-toggleone, I need the old one to accordionIconchange to the opposite arrow, and the new one to change too. I tried to do this with $(".accordion-content").not($(this).next()).parent().find('#accordionIcon'), but could not find the correct item
source
share