title: How to pass links to modal triggered by multiple buttons in bootstrap?
body: <p>I tried the following code found online to trigger one bootstrap modal with multiple buttons.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $(document).ready(function(){
      $("#myModal").on('show.bs.modal', function(event){
      var button = $(event.relatedTarget);  
      var titleData = button.data('title'); 
      var kbtext = button.data('whatever');
      $(this).find('.modal-title').text(titleData);
      $(this).find('.modal-body').text(kbtext);
  });
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>HTML:</p>
  
  <pre><code>&lt;div class="bs-example"&gt;
  &lt;!-- Button HTML (to Trigger Modal) --&gt;
  &lt;button type="button" class="btn btn-primary" data-toggle="modal" data-target="#myModal"
  data-whatever="test 1"    data-title="Test1"&gt;Test 1&lt;/button&gt;
   &lt;button type="button" class="btn btn-primary" data-toggle="modal" data-target="#myModal"
  data-whatever=' Click &lt;a href="https://www.math.washington.edu"&gt;here&lt;/a&gt;'
  data-title="Test2"&gt;Test 2&lt;/button&gt;
  
  &lt;!-- Modal HTML --&gt;
  &lt;div id="myModal" class="modal fade"&gt;
      &lt;div class="modal-dialog"&gt;
          &lt;div class="modal-content"&gt;
              &lt;div class="modal-header" style="text-align:center;"&gt;
                  &lt;button type="button" class="close" data-dismiss="modal" aria-hidden="true"&gt;x&lt;/button&gt;
                  &lt;h4 class="modal-title"&gt;Modal Window&lt;/h4&gt;
              &lt;/div&gt;
              &lt;div class="modal-body"&gt;
              Test body of modal.
                  &lt;/form&gt;
              &lt;/div&gt;
              &lt;div class="modal-footer"&gt;
                  &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Cancel&lt;/button&gt;
                  &lt;button type="button" class="btn btn-primary"&gt;Send&lt;/button&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p></p>
  
  <p>The problem is that the modal does not properly display the link in Test 2 button. I tried all types of combinations of quotes and escape codes for quotes that I could think of. Nothing worked. What quotes should I use for data-whatever for the second button, that is for</p>
  
  <pre><code>data-whatever=' Click &lt;a href="https://www.math.washington.edu"&gt;here&lt;/a&gt;'
  </code></pre>
  
  <p>In particular, the following did not work</p>
  
  <pre><code>  data-whatever=" Click &lt;a href=\"https://www.math.washington.edu\"&gt;here&lt;/a&gt;"
  </code></pre>