title: how to find current active tab id
body: <p>I want to create functionality for save the current tab on postabck.
  for this reason:</p>
  
  <p>1) How to find out the id of current  tab.</p>
  
  <p>2) How can pass that id to hidden variable. 
  I am not using jquery tabs due to some issue. I am creating script using plain jquery script.</p>
  
  <p><strong>This is my JS</strong></p>
  
  <pre><code>$(document).ready(function () {
          $('ul.tabs').each(function () {
  
              var $a, $c, $ = $(this).find('a');
  
              $a = $($links.filter('[href="' + location.hash + '"]')[0] || $links[0]);
              $a.addClass('active');
  </code></pre>
  
  <p><strong>This is HTML for tabs</strong></p>
  
  <pre><code>&lt;div class="co"&gt;
      &lt;ul class="tabs"&gt;
          &lt;li&gt;&lt;a href="#tabs-1"&gt;Tab 1&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href="#tabs-2"&gt;Tab 2&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href="#tabs-3"&gt;Tab 3&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
      &lt;div id="tabs-1"&gt; Content 1 &lt;/div&gt;
      &lt;div id="tabs-2"&gt; Content 2 &lt;/div&gt;
      &lt;div id="tabs-3"&gt; Content 3 &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>