title: How to go to the next tab when clicking on an input in HTML?
body: <p>I want to go to the next tab (id is "profile") when only clicking on the input (id is "sbmt") in the first tab (id is "home").</p>
  
  <p>Here is my HTML code.</p>
  
  <pre><code>&lt;ul class="nav nav-tabs" role="tablist"&gt;
    &lt;li class="active"&gt;&lt;a href="#home" role="tab" data-toggle="tab"&gt;Home&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="#profile" role="tab" data-toggle="tab"&gt;Profile&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="#messages" role="tab" data-toggle="tab"&gt;Messages&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
  
  &lt;div class="tab-content"&gt;
    &lt;div class="tab-pane active" id="home"&gt;
    &lt;br/&gt;
  
      &lt;div class="form-group"&gt;
          &lt;input id ="sbmt" type="submit" name="submit" class="btn btn-success" id="submit" value="Proceed" style="margin-left: 62px; margin-top: -15px; width: 10%; background-color: #20ca53; border: #20ca53;"/&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  
    &lt;div class="tab-pane" id="profile"&gt;
     &lt;br/&gt;
     Profile Content
    &lt;/div&gt;
  
    &lt;div class="tab-pane" id="messages"&gt;
     &lt;br/&gt;
      Messages Content
    &lt;/div&gt;
  
  &lt;/div&gt;
  </code></pre>
  
  <p>Here is my javaScript code.</p>
  
  <pre><code> $(function(){
      var hash = window.location.hash;
      hash &amp;&amp; $('ul.nav a[href="' + hash + '"]').tab('show');
  
      $('.nav-tabs a').click(function (e) {
           $(this).tab('show');
           var scrollmem = $('body').scrollTop();
           window.location.hash = this.hash;
           $('html,body').scrollTop(scrollmem);
      });
   });
  </code></pre>