Currently working on a design for an accordion-style layout and looking to implement toggling arrow icons when the div is clicked. I have managed to toggle the content of the div successfully, but now seeking assistance in achieving the same functionality with the arrow icons.
Here's what I have attempted thus far:
$(document).ready(function() {
$(this).on("click", ".koh-faq-question", function() {
$(this).parent().find(".koh-faq-answer").toggle();
});
});
.koh-faqs-page-title {
font-family: Nexa W01 Heavy;
font-size: 30px;
color: #04202E;
font-weight: 700;
}
.koh-faq-question-span {
font-family: Helvetica Neue LT Pro Roman !important;
font-size: 16px !important;
color: #000 !important;
font-weight: 700 !important;
display: inline-block;
}
.koh-faq-answer {
font-family: Helvetica Neue LT Pro Roman;
color: #000;
font-weight: 400;
display: none;
}
.icon {
font-size: 10px;
padding-right: 5px;
}
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<div class="koh-tab-content">
<div class="koh-tab-content-body">
<div class="koh-faq">
<div class="koh-faq-question">
<i class="fa fa-chevron-right" aria-hidden="true"></i>
<span class="koh-faq-question-span"> Test Question 1 </span>
</div>
<div class="koh-faq-answer">
Test Answer 1
</div>
</div>
</div>
</div>
Seeking guidance on how to update the right icon to toggle to a down icon upon clicking the question. Additionally, we also need it to toggle back to the left icon upon subsequent clicks. Given that this is an FAQ page with multiple questions and answers, needing a solution that can be applied to each one individually.