tags:

views:

30

answers:

2

how do i check which tabs is active using jquery tabs?

+1  A: 

Not too sure about this but I think jQuery dynamically assigns a class of 'ui-state-active'

sk747
Correct, jQuery adds the class `ui-state-active` to the active tab. See http://jqueryui.com/demos/tabs/ with Firebug to see how it works.
Scott
i need to check it programmatically, so i can do actions related to that
user1111111
var selected = $tabs.tabs('option', 'selected'); // => 0
user1111111
+1  A: 

Please try with Index

 function getIndex(){
     return $("ul li.ui-state-active").index();
    }

It will returns the index of selected li or tab.

Vishnu K B