title: How to remember active tab using jQuery.cookies and custom jQuery tabs code?
body: <p>I have written this code to make quick tabs. I need a way to remember active tab after refreshing page.</p>
  
  <p>Here is my basic HTML code:</p>
  
  <pre><code>&lt;ul class="dashboard_tabs"&gt;
      &lt;li&gt;&lt;a href="#" rel="tab1"&gt;Tab 1&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#" rel="tab2"&gt;Tab 2&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#" rel="tab3"&gt;Tab 3&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#" rel="tab4"&gt;Tab 4&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
  
  &lt;div class="dashboard_body" id="tab1"&gt;
  
  &lt;/div&gt;
  
  &lt;div class="dashboard_body" id="tab2"&gt;
  
  &lt;/div&gt;
  
  &lt;div class="dashboard_body" id="tab3"&gt;
  
  &lt;/div&gt;
  
  &lt;div class="dashboard_body" id="tab4"&gt;
  
  &lt;/div&gt;
  </code></pre>
  
  <p>I use rel relations to display the correct tab with this code:</p>
  
  <pre><code>jQuery(document).ready(function(){
      jQuery('.dashboard_body').css({display: 'none'});
      jQuery('.dashboard_tabs a:first').addClass('current');
      var rel = jQuery('.dashboard_tabs a.current').attr('rel');
      jQuery('#'+rel).show();
  
      jQuery('.dashboard_tabs a').click(function(){
          jQuery('.dashboard_tabs a').removeClass('current');
          jQuery('.dashboard_body').hide();
          jQuery(this).addClass('current');
          var rel = jQuery(this).attr('rel');
          jQuery('#'+rel).show();
      });
  });
  </code></pre>
  
  <p>How can I use jQuery cookies to remember active tab?</p>