tags:

views:

331

answers:

1

how to get tab index by tab name in jquery?

i need to remove a certain tab by this command:

$(tabContainer).tabs('remove', index);

the index must contain the correct order of the tab to be closed. the problem is, i'm generating the tabs programmatically so chances of having the wrong index is likely.

A: 

You may need to give an example of your HTML & JS/jQuery but here is what I think you need.

$('ul li a').live('click', function(){ 
    var index = $(this).parent().index($(this).parent());
    alert(index); 
});
Jojo
hmm, didn't work. I'm using jquery-1.2.4b.js because of the closable tabs function.
Martin Ongtangco
What do you mean "closable tabs function"?
T B
yeah, live didnt exist till 1.3. What is the closable tabs function? I think you'll need to show more code.
Jojo