title: Bootstrap : Get Image from modal
body: <p>I have a modal with a bunch of images. The images are selectable and after I click on then i change the modal button text to the image name. However I'd also like to grab the image and display. I have no idea how to do this as I have no experience with javascript.</p>
  
  <p>html modal code:</p>
  
  <pre><code>&lt;button type="button" id="modal-btn" class="btn btn-primary" data-toggle="modal"
          data-target="#myModal"&gt;
      Click to launch Image Gallery...
  &lt;/button&gt;
  &lt;div id='div_img_name'&gt;&lt;/div&gt;
  &lt;!-- Modal --&gt;
  &lt;div class="modal fade" id="myModal" tabindex="-1" role="dialog"
       aria-labelledby="myModalLabel"&gt;
      &lt;div class="modal-dialog" role="document"&gt;
          &lt;div class="modal-content"&gt;
              &lt;div class="modal-header"&gt;
                  &lt;button type="button" class="close" data-dismiss="modal"
                          aria-label="Close"&gt;&lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt;
                  &lt;/button&gt;
                  &lt;h4 class="modal-title" id="myModalLabel"&gt;Image Gallery&lt;/h4&gt;
              &lt;/div&gt;
              &lt;div class="modal-body"&gt;
                  {% for image in images %}
                      &lt;input class="img" type="image" src="{{ image.url }}"
                             height="100" width="130"
                             style="padding-right: 3px;padding-bottom: 3px;"&gt;
                  {% endfor %}
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>js for changing button text:</p>
  
  <pre><code>&lt;script type="application/javascript"&gt;
      $('#myModal').on('shown.bs.modal', function () {
          $('#myInput').focus()
      })
      $(".img").click(function () {
          $("#modal-btn").text($(this).attr('src'));
          $('#myModal').modal('hide');
          return false;
      })
  &lt;/script&gt;
  </code></pre>
  
  <p>How Can I display the chosen Image in the <code>div_img_name</code> div?</p>