I have a html tabbed interface and I want to switch between different tabs based on the item selected in a Combobox using a function. I have tried different solution from previous related question on stackoverflow but none of them is working for me. Could someone please help me out on where I'm missing.
//code for tabs
<div class="container">
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#home">Bio Data</a></li>
<li><a data-toggle="tab" href="#menu1">Insurance Details</a></li>
<li><a data-toggle="tab" href="#menu2">Credit Card Details</a></li>
<li><a data-toggle="tab" href="#menu3">RTA</a></li>
</ul>
<div class="tab-content">
<div id="home" class="tab-pane fade in active">
<input name="surname" id="surname" type="text" /><br />
<input name="otherName" id="otherName" type="text" /><br />
</div>
<div id="menu1" class="tab-pane fade">
<label for="scheme">Scheme Name:</label>
<input name="scheme" id="scheme" type="text" /><br />
<label for="scheme_id">Scheme ID:</label>
<input name="scheme_id" id="scheme_id" type="text" /><br />
</div>
</div>
</div>
//script for switching tabs
<script type="text/javascript" >
function selectTab() {
$("#container").tab("option", "active", 2);
//$('#container a[href="#menu1"]')[2].click();
//$("#menu1").click();
}
</script>
I tried a number of options including the ones commented, but none worked. Please advise.