Is there any way to hide the Jquery UI bootstrap tab I have written code below to show the particular tab
$('#myTab a:last').tab('show')
So i tried using below code to hide tab but it gives error that it has no method hide
$('#myTab a:last').tab('hide')
I have declared tabs in following way in my html
<ul class="nav nav-tabs" id="myTab">
<li><a href="#product" data-toggle="tab">Company</a></li>
<li><a href="#version" data-toggle="tab">Employee</a></li>
</ul>
Have you tried $('#myTab a:last').hide()
or
$('#myTab a:first').hide() ?
Alternatively, you could simply remove the active class from the elements instead:
$('.nav-tabs li.active').removeClass('active');
$('.tab-content div.active').removeClass('active');
This way you won't have any hidden elements that are still marked as active, which may interfere with other JS or CSS.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With