title: get the current tab in jQuery UI tabs
body: <p>I am using jQuery UI Tabs inside of the jQuery UI dialog window.</p>
  
  <p>I've come across an instance, where I need to find the id of the current tab when clicking on one of the dialog buttons.  Looking at the HTML generated by jQuery UI tabs and dialog, I can't really find a way of doing this. The <code>&lt;ul&gt;</code> elements that hold the tab, are about 3 <code>&lt;div&gt;</code>'s away from the group of dialog buttons. </p>
  
  <p>I tried:</p>
  
  <pre><code>$("#DialogBox").dialog({
      autoOpen: false,
      modal: true,
      buttons: [
          {
          text: "Save",
          click: function () {
          var currentTabId = $(this).closest("ul").attr("id");
          alert(currentTabId);
  </code></pre>
  
  <p>But I just get an 'undefined' alert back.</p>
  
  <p>Is there a way of doing this?</p>
  
  <p>Thanks</p>