I am using the following script to detect click event so the accordion item expands and I need to get the div
having class .cellArrow
.
Html
<div class="cellArrow"></div>
JS
$("#accordionContainer").on("accordionbeforeactivate", function (event, ui) {
var cellArrow = $(this).find(".cellArrow");
};
The problem is that each section of accordion has this class so here I have the all .cellArrow
classes.
My question is how to obtain the <div>
exactly within a fireing accordion element?
Thank you!
P.S. Here is HTML I have:
<div id="accordionContainer">
<h3>Item 1
<div class="cellArrow"></div>
</h3>
<div>First content panel</div>
<h3>Item 2
<div class="cellArrow"></div>
</h3>
<div>Second content panel</div>
</div>
try this code,