title: Activating second tab in page load using jquery
body: <p>how can i activate the second tab of my web page in page load , i have done the tabs using jquery and ul.</p>
  
  <p>below is the codes</p>
  
  <pre><code>&lt;div class="tabcontainer"&gt;
    &lt;ul class="tabs"&gt;
      &lt;li&gt;&lt;a href="#tab1"&gt;Saved Recipes&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#tab2"&gt;Groups&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#tab3"&gt;Friends&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#tab4"&gt;My Recipes&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/div&gt;
  
  &lt;div class="tab_container"&gt;
  &lt;!-- Tab 1 Starts Here  --&gt;
    &lt;div id="tab1" class="tab_content"&gt;&lt;/div&gt;    
    &lt;div id="tab2" class="tab_content"&gt;&lt;/div&gt;
    &lt;div id="tab3" class="tab_content"&gt;&lt;/div&gt;    
    &lt;div id="tab4" class="tab_content"&gt;&lt;/div&gt;    
  &lt;/div&gt;
  </code></pre>
  
  <p>Script:   </p>
  
  <pre><code>$(document).ready(function() {
      //Default Action
      $(".tab_content").hide(); //Hide all content
      $("ul.tabs li:first").addClass("active").show(); //Activate first tab
      $(".tab_content:first").show(); //Show first tab content
  
      //On Click Event
      $("ul.tabs li").click(function() {
          $("ul.tabs li").removeClass("active"); //Remove any "active" class
          $(this).addClass("active"); //Add "active" class to selected tab
          $(".tab_content").hide(); //Hide all tab content
          var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
          $(activeTab).fadeIn(); //Fade in the active content
          return false;
      });
  });
  </code></pre>
  
  <p>I know how to activate first and last one, but how can i activate the second and third one during page load.</p>
  
  <p>please help...</p>