I\'m using Bootstrap to make collapsible nested divs/buttons. I want to collapse all siblings of a div when it is expanded and to collapse all children of a div when it is colla
Try
$(function() {
$(".collapse").on('show.bs.collapse', function(e) {
if ($(this).is(e.target)) {
snippet.log(this.id)
}
})
});
Collapsible Group Item #1-1
Collapsible Group Item #1-1-2
Collapsible Group Item #2-1-2
Collapsible Group Item #3-1-2
Collapsible Group Item #3-1
Collapsible Group Item #2
Collapsible Group Item #3