Tutorialsplane

Bootstrap disable tabs


Bootstrap disable tabs We can make tabs disabled using jQuery. Here in this article we are going to explain how you can use jQuery to disable tabs.


Bootstrap disable tabs Example

You can add disabled class and the below jQuery to check the disabled class and return false-

Bootstrap disable tabs Example:



<title>Bootstrap Grid</title>
<!-- Latest compiled and minified CSS -->


<!-- Latest compiled and minified JavaScript -->




<div class="container">
  <h3>Tabs</h3>
  <ul class="nav nav-tabs mytabs">
    <li class="active"><a href="#tab1">Home</a></li>
    <li><a href="#tab2">Menu 1</a></li>
    <li><a href="#tab3">Menu 2</a></li>
    <li><a href="#tab4" class="disabled">Menu 3</a></li>   
  </ul>
 <div id="tab1" class="tab-pane fade in active">Tab 1</div>
<div id="tab2" class="tab-pane fade">Tab 2</div>
<div id="tab3" class="tab-pane fade">Tab 3</div>
<div id="tab4" class="tab-pane fade ">Tab 4</div>

</div>


Try it »

If you click on the disabled menu it will display the alert message – “This tab is disabled.”