title: Return index of currently open tab
body: <p>I have some logic which refreshes a portion of my page after I enter some data. The data entry form is on the second tab of a three tab table. When one tab is open the other two are closed.</p>
  
  <p>When I enter the data, the refresh function closes the second tab and opens the first one again, I want the second tab to remain open. </p>
  
  <p>I'm looking for a way of getting the index of the currently open tab which I think will put me on the right path to solving this problem.</p>
  
  <p>So how do I get the index of the currently open tab?</p>
  
  <p>Someone has already asked the same <a href="https://stackoverflow.com/questions/15367234/get-index-of-activated-tab">question</a> but I can't seem to get the answer to work for me!</p>
  
  <pre><code> var index;
  
   jQuery("#tabs").tabs({
       activate: function (event, ui) {
       index = (ui.newTab.index());
       }
   });
  </code></pre>