title: How to open a Bootstrap modal window with image on every click?
body: <pre><code>&lt;button type="button" id="imgInput" class='input-medium'&gt;Upload image&lt;/button&gt;
  
  Bootstrap Modal
  &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;&amp;nbsp;&lt;/h4&gt;
  &lt;/div&gt;
  &lt;div class="modal-body"&gt;
  &lt;img src="1.png" /&gt;&lt;img src="2.png" /&gt;&lt;img src="3.png" /&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  
  This Is the jquery portion
  $('#myModal img').click(function(){
  $('#myModal').modal('show');
  var src = $(this).attr('src');
  //alert(src); // on load
  $('#Backgroundsrc').attr('src',src);
  $('#myModal').modal('toggle');
  });
  $("#imgInput").on('click',function(){
  $('#myModal').modal('show');
  });
  </code></pre>
  
  <p>I have a Bootstrap modal window. It contain images. By using a button call modal and select image.But the next time when click on button window appears but there is no images.I want to show the modal window with images on every button click.</p>