I want my accordion to automatically open the first item body by manually closing the all bodies in accordion
$(document).ready(function(){
$('#accordionExample').each(function(i){
$(this).on("click" ,{value:i},function(event){
var allCollapsed = true;
$('.accordion-item').each(function() {
if ($(this).find('.collapse').length > 0) {
allCollapsed = false;
return false;
}
});
if(allCollapsed==true)
{
alert("ban");
}
});
});
});