I have the following codes not working correctly except Mozilla Firefox browser. I’m using Bootstrap 5.3. Anyone can help me for a working tablist with select option?
Here is my codes not working in google chrome and other browser except firefox.
<div class="select-dropdown">
<select id="bTransaction" role="tablist">
<option class="active" id="business1-tab" data-bs-toggle="tab" data-bs-target="#business1" role="tab" aria-controls="business1" aria-selected="true">Business 1</option>
<option id="business2-tab" data-bs-toggle="tab" data-bs-target="#business2" role="tab" aria-controls="business2" aria-selected="false">Business 2</option>
<option id="business3-tab" data-bs-toggle="tab" data-bs-target="#business3" role="tab" aria-controls="business3" aria-selected="false">Business 3</option>
</select>
</div>
<div class="tab-content" id="bTransactionContent">
<div class="tab-pane fade show active" id="business1" role="tabpane" aria-labelledby="business1-tab">
Business 1 Content
</div>
<div class="tab-pane fade" id="business2" role="tabpane" aria-labelledby="business2-tab">
Business 2 Content
</div>
<div class="tab-pane fade" id="business3" role="tabpane" aria-labelledby="business3-tab">
Business 3 Content
</div>
</div>
2
Answers
Here I've found a solution-
try to ad dropdown without bootsrtap attributes for tab switching , add event listener to the select dropdown and hide all tab panes and then show the selected tab : if (selectedTab){
selcetedTab.classList.add(‘show’,’active’);
}