title: How to switch one tab to another on button click if using bootstrap?
body: <p>I have a page where i have 4 tabs. I want to move first tabs if user click on button. Same button is showing on all tabs. If user is on first tab, then user remains on first tab after clicking on button and if user is on any other tab except first tab then user should move to first tab on clicking button.I am using bootstrap.Here is my code:</p>
  
  <pre><code>  &lt;div class="tabsControlStyling"&gt;
          &lt;ul class="nav nav-tabs"&gt;
                          &lt;li class="active"&gt;&lt;a data-toggle="tab" href="#home"&gt; Home&lt;/a&gt;&lt;/li&gt;
                          &lt;li&gt;&lt;a data-toggle="tab" href="#menu1"&gt;Menu1&lt;/a&gt;&lt;/li&gt;
                          &lt;li&gt;&lt;a data-toggle="tab" href="#menu2"&gt;Menu2&lt;/a&gt;&lt;/li&gt;
                          &lt;li&gt;&lt;a data-toggle="tab" href="#menu3"&gt; Menu3&lt;/a&gt;&lt;/li&gt;
                          @*&lt;li&gt;&lt;a data-toggle="tab" href="#menu3"&gt;Menu 3&lt;/a&gt;&lt;/li&gt;*@
                      &lt;/ul&gt;
  
            &lt;div class="tab-content"&gt;
                  &lt;div id="home" class="tab-pane fade in active"&gt;
                  //Content
                  &lt;/div&gt;
                  &lt;div id="menu1"&gt;
                  &lt;/div&gt;
                  &lt;div id="menu2"&gt;
                  &lt;/div&gt;
                  &lt;div id="menu3"&gt;
                  &lt;/div&gt;
            &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>How i can switch to tab "home" on clicking button. I have tried this but it's not working.</p>
  
  <pre><code>$('#button').submit(function () {
                  debugger;
                  $("#home").tab('show');
  });
  </code></pre>
  
  <p>This is not working. How i can do this?</p>