title: How to open a Bootstrap modal with a specific tab active
body: <p>I am trying to have the tab within the bootstrap modal open depending on what link is being clicked. No matter what I've tried it will only open up on the first tab. The two links are the following:</p>
  
  <pre><code>&lt;a href="#tab-mileage" data-toggle="modal" data-target="#buyers-report-modal" &gt;Mileage&lt;/a&gt;
  &lt;a href="#tab-wrong-vehicle" data-toggle="modal" data-target="#buyers-report-modal"&gt;Wrong vehicle?&lt;/a&gt;
  </code></pre>
  
  <p>and the markup for the modal is here:</p>
  
  <pre><code>&lt;div class="modal" id="buyers-report-modal" tabindex="-1" role="dialog" aria-hidden="true"&gt;
    &lt;div class="modal-dialog modal-lg modal-offset-top"&gt;
      &lt;div class="modal-content"&gt;
      &lt;div class="modal-body"&gt;
      &lt;div class="sd-tabs sd-tab-interaction"&gt;
        &lt;div class="row"&gt;
          &lt;ul class="nav nav-tabs col-md-3 custom-bullet"&gt;
  
            &lt;li class="active"&gt;&lt;a data-toggle="tab" href="#tab-wrong-vehicle"&gt; Wrong Vehicle?&lt;/a&gt;&lt;/li&gt;
            &lt;li&gt;&lt;a data-toggle="tab" href="#tab-mileage"&gt; Mileage&lt;/a&gt;&lt;/li&gt;
  
          &lt;/ul&gt;
          &lt;div class="tab-content col-md-9"&gt;
            &lt;form id="tab-wrong-vehicle" class="tab-pane active" action="" method="post"&gt; &lt;!-- Wrong Vehicle? --&gt;
  
              &lt;h3 class="tab-title"&gt;Tab 1&lt;/h3&gt;
  
            &lt;/form&gt; &lt;!-- Wrong Vehicle? --&gt;
  
  
  
            &lt;form id="tab-mileage" class="tab-pane"&gt; &lt;!-- Mileage --&gt;
  
              &lt;h2 class="tab-title-resp hidden-md hidden-lg"&gt; Mileage&lt;/h2&gt;
              &lt;h3 class="tab-title"&gt;Tab 2&lt;/h3&gt;
  
            &lt;/form&gt; &lt;!-- Mileage --&gt;
  
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I need the modal to open up on the link that is clicked, for example,if I were to click on the second link it would open up the second tab in the modal. Any help would be greatly appreciated, I haven't been able to find a solution to this anywhere.</p>
  
  <p>I left the original ID's in the code incase I made a mistake in replacing them.</p>