title: Twitter Bootstrap: Getting the index of an open tab
body: <p>I'm trying to get the index of a tab when it opens in Twitter Bootstrap (3.3), but it keeps giving me an index of <code>0</code>. I've checked out <a href="https://stackoverflow.com/questions/18023473/how-can-i-get-the-clicked-or-active-number-of-tab">this question</a> but <code>a)</code> it's apparently for an older version of Bootstrap (<code>shown</code> instead of <code>shown.bs.tab</code>, etc), and <code>b)</code> I tried to use an updated version of the code(<code>shown.bs.tab</code>) and it didn't work.</p>
  
  <p>Any idea of how to do this in Bootstrap 3.3?</p>
  
  <pre><code>$('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
    console.log($(e.target).index());
  });
  </code></pre>
  
  <p><a href="http://jsfiddle.net/eazg9hoe/" rel="nofollow noreferrer">I've created a JSFiddle here.</a></p>