title: How do you update an existing Bootstrap modal data-target?
body: <p>I tried to update an existing <code>data-target</code> with a <code>data-target="#testModal1"</code> to point to the <code>#testModal2</code> modal using jquery <code>.data</code>, but even after the data attribute change it still is linked to <code>#testModal1</code></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>//Jquery:
  
  $('#testButton').data('target', '#testModal2')</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!-- HTML: --&gt;
  
  
  &lt;button id='testButton' data-toggle="modal" data-target="#testModal1"&gt;
        Test
      &lt;/button&gt;
  
  &lt;div class="modal fade" id="testModal1" tabindex="-1" role="dialog" aria-hidden="true" style='display:none'&gt;
    &lt;div class="modal-dialog"&gt;
      &lt;div class="modal-content"&gt;
        Testing Testing 1
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;div class="modal fade" id="testModal2" tabindex="-1" role="dialog" aria-hidden="true" style='display:none;'&gt;
    &lt;div class="modal-dialog"&gt;
      &lt;div class="modal-content"&gt;
        Testing Testing 2
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>