I have two buttons positioned next to each other:
Button-A displays all the headings, while Button-B displays all the headings with descriptions. My goal is to allow the user to click on Button-A and have it switch to Button-B, opening all the accordions in Button-B. Similarly, clicking on Button-B should directly open all the accordion items for Button-B while keeping Button-A's accordions closed.
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="4b3b243b3b2e396521380b7a657a796571">[email protected]</a>/dist/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="a9cbc6c6dddadddbc8d9e99d87998798">[email protected]</a>/dist/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<link href="https://kit-pro.fontawesome.com/releases/v5.15.4/css/pro.min.css" rel="stylesheet" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="e1838e8e959295938091a1d5cfd1cfd2">[email protected]</a>/dist/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<div class="col-lg-12 mt-5 tab-accrd">
<ul class="nav nav-tabs" id="myTab" role="tablist">
<li class="nav-item">
<a class="nav-link active" id="home-tab" data-toggle="tab" href="#home2" role="tab" aria-controls="home2" aria-selected="true">Button-A</a>
</li>
<li class="nav-item ml-3">
<a class="nav-link" id="home-tab" data-toggle="tab" href="#home2" role="tab" aria-controls="home2" aria-selected="true">Button-B</a>
</li>
</ul>
<div class="tab-content mt-1" id="myTabContent">
<div class="tab-pane fade show active" id="home2" role="tabpanel" aria-labelledby="home-tab">
<div id="accordion" role="tablist" aria-multiselectable="true">
<!-- Accordion Item 1 -->
<div class="card">
<div class="card-header" role="tab" id="accordionHeadingOne1">
<div class="mb-0 row">
<div class="col-12 no-padding accordion-head">
<a data-toggle="collapse" data-parent="#accordion" href="#accordionBodyOne1" aria-expanded="false" aria-controls="accordionBodyOne1" class="collapsed acc-head">
<i class="fas fa-caret-square-down" aria-hidden="true"></i>
<h5> <span>1</span> Accordion Item 1 - Heading</h5>
</a>
</div>
</div>
</div>
<div id="accordionBodyOne1" class="collapse" role="tabpanel" aria-labelledby="accordionHeadingOne1" aria-expanded="false" data-parent="accordion">
<div class="card-block col-12">
<p>Accordion Item 1 - Body</p>
<p>Content goes here...</p>
</div>
</div>
</div>
<!-- Additional Accordion Items go here... -->
</div>
</div>
</div>
</div>