One thought is that perhaps I should create an array and just .each() all of the tabs to create references in the manner I would like but it seems there is probably already a way to do this I just may not be aware of the scope or syntax.
For instance I have $tabs.tabs() and I want to change the AJAX URL and title of a given index such as:
for (var x = index; x < (tab_counter - 1); x++) {
$tabs.tabs(x).text(!!$tabs.tabs(x + 1).text() ? $tabs.tabs(x + 1).text() : "Deleted");
//is there a syntax to refer to tabs in this manner?
}
$tabs has been initialized as
var $tabs = $("#pages").tabs( ...
Assume that tab_counter is kept up to date (it is incremented and decremented in the add and remove events) – If I try as suggested something like
for (var x = 0; x < (tab_counter - 1); x++) {
console.log($tabs.tabs.eq(x).text() + " @ index " + x);
}
In order to for example loop through all of the tabs titles. Is there something I am missing here in the syntax? eq() seems to be the right solution, but I suspect I am not using it right.
Solution
$tabis = $('#pages ul li a');
for (var x = 0; x < tab_counter; x++) {
console.log($tabis.eq(x).text() + " at " + x);
}
/* Prints the text label of each tab within the selected list of tabs. */
Thank you for your help dbaseman thats exactly what I was looking for. And I learned in the process so I am greatful for that
Use eq perhaps?