Bootstrap get active tabs index using jQuery Example

Today, We want to share with you Bootstrap get active tabs index using jQuery Example.In this post we will show you bootstrap tabs get active tab id, hear for jQuery Get Selected Bootstrap Tab or Active Tab on Click (Change) Example we will give you demo and example for implement.In this post, we will learn about Find Active Tab using jQuery and Twitter Bootstrap with an example.

Bootstrap get active tabs index using jQuery Example

There are the Following The simple About Bootstrap get active tabs index using jQuery Example Full Information With Example and source code.

As I will cover this Post with live Working example to develop bootstrap get active tab index, so the bootstrap set active tab javascript for this example is following below.

Example 1 : Twitter Bootstrap get active

Get Active Tab using jQuery with Twitter Bootstrap

// UL Li Twitter Bootstrap defines the active class

//An alternative -> shown event of each tab
var currentTab = null;
$('a[data-toggle="tab"]').on('shown', function (e) {
  currentTab =;

Example 2 : bootstrap get active tab index


<html xmlns="">
      <title>Find Active Tab using jQuery and Twitter Bootstrap</title>
      <link rel="stylesheet" href="">
      <script src=""></script>
      <script src=""></script>
      <script type="text/javascript">
         $(function () {
             $('a[data-toggle="tab"]').on('', function (e) {
                 var target = $("href")
      <h1>how to get active bootstrap tab id in jquery</h1>
      <form id="form1">
         <br />
         <ul class="nav nav-tabs" >
            <li><a href="#tab1" data-toggle="tab">Home</a></li>
            <li><a href="#tab2" data-toggle="tab">AboutUS</a></li>
            <li><a href="#tab3" data-toggle="tab">Contactus</a></li>
            <div class="tab-content" id="tabs">
               <div class="tab-pane" id="tab1">...Sample Home...</div>
               <div class="tab-pane" id="tab2">...Sample AboutUS...</div>
               <div class="tab-pane" id="tab3">...Sample Contactus...</div>

Example 3 : Bootstrap tab activation in JQuery

javascript – Bootstrap tab activation with JQuery

<ul class="nav nav-tabs" style="text-align: left;">
    <li class="active"><a href="#home" data-toggle="tab" id="home_tab">Home</a></li>
    <li><a href="#about" data-toggle="tab" id="about_tab">about</a></li>
    <li><a href="#contact" data-toggle="tab" id="contact_tab">contact</a></li>

<div class="tab-content">

    <div id="home" class="tab-pane fade in active">
        HOME Page Data Contents
        <a class="btn btn-primary btn-lg" onclick="$('#about_tab').trigger('click')">about</a>
        <a class="btn btn-primary btn-lg" onclick="$('#contact_tab').trigger('click')">contact</a>

    <div id="about" class="tab-pane fade in">
        About Page Data Contents

    <div id="contact" class="tab-pane fade in">
        Contact Page Data Contents

Angular 6 CRUD Operations Application Tutorials

Read :

Also Read This 👉   Dynamically set active tab in jquery


You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about Bootstrap get active tabs index using jQuery Example.
I would like to have feedback on my blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.