Looking for the best way to switch tabs using a dropdown select
. I was thinking of using onChange
event to manipulate the .active
class, but there might be a better approach out there.
Please see below for a code snippet:
<select id="mySelect">
<option value="tab1">Tab 1</option>
<option value="tab2">Tab 2</option>
<option value="tab3">Tab 3</option>
</select>
<div id="myTabContent" class="tab-content">
<div class="tab-pane fade in active" id="tab1">
<div id="calendari_3">asd</div>
</div>
<div class="tab-pane fade" id="tab2">
<div id="calendari_1">qwe</div>
</div>
<div class="tab-pane fade" id="tab3">
<div id="calendari_2">asw</div>
</div>
</div>