Bongani Ngcobo
Bongani Ngcobo

Reputation: 23

How do I toggle two divs in bootstrap using a tags not buttons at the same time?

This is my toggling link

 <li role="presentation"><a data-toggle="collapse" href="#shortTermOpt,#longTermOpt" role="menuitem" tabindex="-1" >Short Term</a></li>

DIV 1

<div  id="shortTermOpt" class="form-group collapse"  style="">
...
</div>

DIV 2

<div  class="form-group collapse in" id="longTermOpt" style="">
...
</div>

Upvotes: 1

Views: 2040

Answers (2)

chainable
chainable

Reputation: 119

Now you can use bootstrap multi-collapse data-bs-target=".multi-collapse" and class="collapse multi-collapse"

Upvotes: 0

Sleh Abdelkefi
Sleh Abdelkefi

Reputation: 46

instead of href try to use data-target ="#shortTermOpt,#longTermOpt"

Upvotes: 3

Related Questions