title: open a specific tab in modal
body: <p>How do I open a specific tab inside a modal using Javascript? Here is my code. When someone clicks on the following buttons, E.g OPEN TAB1 should open TAB1 content and OPEN TAB2 should open TAB2 content</p>
  
  <pre><code>&lt;!-- Button trigger modal --&gt;
  &lt;a data-toggle="modal" class="btn" href="#loginModal"&gt;OPEN TAB1&lt;/a&gt;
  
  &lt;a class="btn" id="btnRegister"&gt;OPEN TAB2&lt;/a&gt;
  
  &lt;!-- modal --&gt;
  
  &lt;div class="well modal fade" id="loginModal"&gt;
            &lt;div class="modal-body" style="text-align:left;"&gt;
                &lt;div class="row-fluid"&gt;
                    &lt;div class="span10 offset1"&gt;
                        &lt;div id="modalTab"&gt;
                            &lt;div class="tab-content"&gt;
                                &lt;div class="tab-pane active" id="login"&gt;
                                   TAB 1 CONTENTS
                                &lt;/div&gt;
                                &lt;div class="tab-pane fade" id="create"&gt;
                               TAB 2 CONTENTS 
                              &lt;a href="#login" data-toggle="tab"&gt;OPEN TAB 1
                                    &lt;/div&gt;
                                &lt;/div&gt;
                            &lt;/div&gt;
  
            &lt;div class="modal-footer well"&gt;
  
              &lt;a href="#create"  data-toggle="tab" class="btn btn-success"&gt;OPEN TAB 2&lt;/a&gt;
            &lt;/div&gt;
                &lt;/div&gt;
  </code></pre>
  
  <p>the following script doesnot work for me</p>
  
  <pre><code> &lt;script&gt; 
      $('#btnRegister').on('click', function() {
  
           $('#loginModal').modal('show');
          $('.modalTab #create').tab('show');
  
      });
      &lt;/script&gt;
  </code></pre>