Search code examples
jquerytwitter-bootstrap-3bootstrap-tabs

Bootstrap Tabs how to tell which tab is the active one in jQuery?


There's a similar thread about this, but it's in AngularJS. How do I tell which tab in the Bootstrap 3 Tabs as the "active" one in jQuery only?

thanks.


Solution

  • You can grab the active tab by doing:

    $('.nav').find('li.active')
    

    You can easily replace the .nav with the selector that will identify the UL tag surrounding your tabs.