I\'ve been racking my brain for a little while now, and I would like to know if anyone out there knows how I can find the active tab, using jQuery and Twitter\'s Bootstrap.
Twitter Bootstrap assigns the active class to the li element that represents the active tab:
$("ul#sampleTabs li.active")
An alternative is to bind the shown event of each tab, and save the active tab:
var activeTab = null;
$('a[data-toggle="tab"]').on('shown', function (e) {
activeTab = e.target;
})