Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get Current Active Tab through JS.

I want to display the current tab as active in BOOTSTRAP.

<ul class="nav nav-tabs">               
    <!-- Default tab -->
    <li class="active"><a href="#elemLower_tab" data-toggle="tab">Elementary Lower</a></li>
    <li><a href="#elemAdvance_tab" data-toggle="tab">Elementary Advance</a></li>
    <li><a href="#secondary_tab" data-toggle="tab">Secondary</a></li>               
</ul>

I want to get the current tab active through jQuery? Is there a way to do this?

like image 465
newbie Avatar asked Nov 03 '13 08:11

newbie


1 Answers

Try

$('.nav-tabs .active').text()
like image 140
Arun P Johny Avatar answered Oct 05 '22 21:10

Arun P Johny