title: how to pass ID from the button to the modal body when a button is clicked?
body: <p>I have a button with its id and I want to pass this id to the modal body.how can I pass it to the modal body?</p>
  
  <p>button with id with <code>var=q</code></p>
  
  <pre><code>&lt;td&gt;&lt;button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#myModal2" id="${q.id}"&gt;Confirm&lt;/button&gt;
  </code></pre>
  
  <p>modal content</p>
  
  <pre><code>&lt;div class="modal fade" id="myModal2" role="dialog"&gt;
          &lt;div class="modal-dialog modal-lg"&gt;
              &lt;div class="modal-content"&gt;
                  &lt;div class="modal-header"&gt;
                      &lt;button type="button" class="close" data-dismiss="modal"&gt;&amp;times;&lt;/button&gt;
                      &lt;h4 class="modal-title"&gt;Send an Email&lt;/h4&gt;
                  &lt;/div&gt;
                  &lt;div class="modal-body"&gt;
                      &lt;g:form action="send"&gt;
                       &lt;h4&gt;Email to:&lt;/h4&gt;&lt;g:textField name="email" placeholder="Enter email" value=""/&gt;&lt;br&gt;
                          &lt;h4&gt;Subject:&lt;/h4&gt;&lt;g:textField name="subject" placeholder="Enter subject"/&gt;&lt;br&gt;
                         &lt;h4&gt;Description:&lt;/h4&gt;&lt;g:textArea name="body" placeholder="Enter body"/&gt;&lt;br&gt;
                          &lt;g:submitButton name="send" value="send"/&gt;
                      &lt;/g:form&gt;
                  &lt;/div&gt;
                  &lt;div class="modal-footer"&gt;
                      &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Close&lt;/button&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>