title: How to pass dynamic data in bootstrap modal?
body: <p>I am trying to achieve the following:</p>
  
  <p>I have a button :</p>
  
  <pre><code>&lt;button id= "&lt;dynamicid&gt;" type="button" class="btn btn-danger btn-sm pull-right" data-toggle="modal" data-target="#mymodal"&gt;Open&lt;/button&gt;
  </code></pre>
  
  <p>The id attribute changes everytime. Now clicking this button opens up a modal. What I am trying to achieve is get this dynamic id into the modal which opens up.</p>
  
  <p>Here is the full modal:</p>
  
  <pre><code>&lt;div class="modal fade" id="mymodal" data-placement="right" role="dialog"&gt;
      &lt;div class="modal-dialog"&gt;
        &lt;!-- Modal content--&gt;
        &lt;div class="modal-content"&gt;
          &lt;div class="modal-header" style="padding: 4%; background-color: white; color: #6A6A6A; font-family: 'Crete Round', serif;"&gt;
          &lt;input type="submit" class="btn btn-primary btn-sm" value="submit"/&gt;
          &lt;div class="modal-footer"&gt;
          &lt;/div&gt;
        &lt;/div&gt;      
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Any suggestions on this would be of great help.</p>