title: jQuery append() not working inside a bootstrap modal
body: <p>I have a bootstrap modal as following:</p>
  
  <pre><code>&lt;div class="modal fade" id="container-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" data-backdrop="false"&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;Modal title&lt;/h4&gt;
        &lt;/div&gt;
        &lt;div class="modal-body"&gt;
          &lt;ul class="modal_containers" id="list_ctns"&gt;
           &lt;li&gt;&lt;img src="images/container.png"&gt;&lt;/li&gt;
           &lt;li&gt;&lt;img src="images/container.png"&gt;&lt;/li&gt;
           &lt;li&gt;&lt;img src="images/container.png"&gt;&lt;/li&gt;
          &lt;/ul&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;button type="button" class="btn btn-primary"&gt;Save changes&lt;/button&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>The above modal is triggered when a particular button is clicked which can be considered as a repository of certain elements.</p>
  
  <p>I have a form which has a submit button. On clicking that submit button, I want to append a list item to the modal_body.</p>
  
  <pre><code>&lt;div class="button-containers"&gt;
   &lt;button class="btn btn-success" id="save_item" type="submit"&gt;Save&lt;/button&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>So, I wrote this simple javascript snippet to append the list item to the modal.</p>
  
  <pre><code>$(document).ready(function(){
  $('#save_item').click(function(e){
     $("#list_ctns").append("&lt;li&gt;&lt;img src="images/container.png"&gt;&lt;/li&gt;")
  });
  
  });
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/w5obh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/w5obh.png" alt="The current Modal"></a></p>
  
  <p>I am not sure, where I am making a mistake. Please help me with your suggestions.</p>
  
  <p>Cheers,
  SZ</p>