I have the following code which gets the id of the currently selected jquery-ui-tab:
$($('[id^="tab"], [id^="home"]')).live('click', function() {
alert($(this).attr("id"));
});
As you can see, I have 2 sets of tabs, tab(n) and home(n).
This works fine, except that I need to be able to get the id at any point in time, not when the tab is selected, the code above only gets the id when a tab is selected.
How do I get the id of the jquery-ui-tabs home(n) and tab(n) using a standard button clicked i.e.
$("#button_one").click(function(event) {
// get id of selected tab
});
jQuery version < 1.6:
Note that I would change your first function to:
And don’t use
liveunless your jQuery version is < 1.4.4A way to get the index: