title: Find Active Tab using jQuery and Twitter Bootstrap
body: <p>I've been racking my brain for a little while now, and I would like to know if anyone out there knows how I can find the active tab, using jQuery and Twitter's Bootstrap.  Pulling the hash from the URL is not my first option, I'm using the <code>data-toggle</code> attribute in the <code>&lt;a&gt;</code> link so there is no need to produce a URL hash.</p>
  
  <p>Any insight?  Here's an example of my markup:</p>
  
  <pre><code>&lt;ul class="nav nav-list" id="sampleTabs"&gt;
      &lt;li&gt;&lt;a href="#example" data-toggle="tab"&gt;Tab 1&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
  &lt;div class="tab-content"&gt;
      &lt;div class="tab-pane fade active in" id="example"&gt;
          Example Tab
      &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;script&gt;
  $('#sampleTabs a:first').tab('show');
  &lt;/script&gt;
  </code></pre>
  
  <p>I'm open to any suggestion - using a PHP session, JS cookie, etc.</p>
  
  <p>Edit: This is the real issue.  I have a pagination system using PHP, so when a page number or next/prev arrow is clicked, it will reload the page.  This is why I need to find the active tab before loading the next page, since I"ll just pass it in the url or session, etc.</p>