title: jQuery ui.index is always undefined
body: <p>I have a problem when i try to remember the last clicked tab in jQuery. I want to use ui.index in the javascript code, but i found it always get undefined. </p>
  
  <p>Here is my code:</p>
  
  <pre><code>$('#tabs').bind('tabsselect', function(event, ui) {
    var newIndex = ui.index;
    $("#&lt;%=hiddenSelectedTab.ClientID%&gt;").val(newIndex);
  });
  </code></pre>
  
  <p>Does anyone know how to solve it? Thanks</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>Here is my html code: </p>
  
  <pre><code>&lt;div id="tabs"&gt;
      &lt;ul&gt;
         &lt;li&gt;&lt;a href="#link1"&gt;
               link1&lt;/a&gt;&lt;/li&gt;
         &lt;li&gt;&lt;a href="#link2"&gt;
               link2&lt;/a&gt;&lt;/li&gt;
         &lt;li&gt;&lt;a href="#link3"&gt;
               link3&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
      &lt;div id="link1"&gt;&lt;/div&gt;
      &lt;div id="link2"&gt;&lt;/div&gt;
      &lt;div id="link3"&gt;&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I use a hiddenField to remember the tab i choosed. </p>
  
  <pre><code>&lt;input type="hidden" id="hiddenSelectedTab" runat="server" value="0" /&gt;
  </code></pre>
  
  <p>My javascript code modified:</p>
  
  <pre><code>$(document).ready(function() {
              $("#tabs").tabs().tabs('select', parseInt($("#&lt;%=hiddenSelectedTab.ClientID%&gt;").val()));
              var $tabs = $("#tabs").tabs();
              var selected = $tabs.tabs("option", "selected");
              $("#&lt;%=hiddenSelectedTab.ClientID%&gt;").val(selected);
  });
  </code></pre>
  
  <p>This line always return 0. </p>
  
  <pre><code>var selected = $tabs.tabs("option", "selected");
  </code></pre>
  
  <p>I'm really confused. :(</p>