Get the selected tab : getting random number

Get the selected tab : getting random number

Hi,

I would like to get the selected tab, I'm using as suggested in the documentation :

var selected = $("#tabs").tabs('option', 'selected');

But the problem with that, is that it returns me once an index 0 for example for a specific tab, then it will be 5, etcetera, seems quite random.

Thank you for any help.