I' am using jQuery to get the previous DIV with Class "our-partner-readmore". I have tried alot but was not possible in doing it.
HTML
<div class="our-partner-readmore"><a class="accordion-toggle btn-readmore collapsed" data-toggle="collapse" data-parent="#accordion2" href="#collapse2"></a></div>
<div class="our-partner-readmore"><a class="accordion-toggle btn-readmore collapsed" data-toggle="collapse" data-parent="#accordion2" href="#collapse2"></a></div>
JS
$('a.btn-readmore').on("click", function(){
var is_collapsed = $(this).hasClass("collapsed");
alert(is_collapsed);
if(is_collapsed){
$(this).prev('.our-partner-readmore').addClass("none");
$(this).next('.our-partner-readmore-closed').removeClass("none");
} else {
$(this).prev('.our-partner-readmore-closed').addClass("none");
$(this).next('.our-partner-readmore').removeClass("none");
}
});
More Explaination
Whenever some clicks on the "a.btn-readmore", Using jQuery am trying to get the previous div class "our-partner-readmore" dynamically.
Thanks guys