For Bootstrap v4.1
Add the data-parent
attribute to the collapse
elements instead on the button
.
<div id="myGroup">
<button class="btn dropdown" data-toggle="collapse" data-target="#keys"><i class="icon-chevron-right"></i> Keys <span class="badge badge-info pull-right">X</span></button>
<button class="btn dropdown" data-toggle="collapse" data-target="#attrs"><i class="icon-chevron-right"></i> Attributes</button>
<button class="btn dropdown" data-toggle="collapse" data-target="#edit"><i class="icon-chevron-right"></i> Edit Details</button>
<div class="accordion-group">
<div class="collapse indent" id="keys" data-parent="#myGroup">
keys
</div>
<div class="collapse indent" id="attrs" data-parent="#myGroup">
attrs
</div>
<div class="collapse" id="edit" data-parent="#myGroup">
edit
</div>
</div>