title: Jquery UItabs get index of specific tab
body: <p>I'm looping through the Jquery tabs to see if a tab with a specific name exists. If it does, I need to get it's index. I'm able to identify if it exists, but can't seem to get the correct index. Here's the code:</p>
  
  <pre><code>        var exists = false;
          $(".ui-tabs-anchor").each(function(index){
              if ($(this).text() == stock){
                  exists = true;  
                  var index = $(this).index();  &lt;---- problem here
                  $("#tabs").tabs({active: index});
              }
          });
  </code></pre>
  
  <p>I've labeled what I think the problem is. I've tried, ui.index, ui.newTab.index, etc.. Can someone help me to see what I'm doing wrong as well as how to look up where to find it? Looking through the API I keep missing it for some reason. Thanks!</p>