title: How to Clear Content - Bootstrap Modal
body: <p>Everytime I open a Bootstrap Modal form, I want a fresh load of content instead of adding to existing form (default behavior). So I want <code>hello world</code> to show on the form once instead of keep appending them to each other. I looked up how to do this on here and tried all answers but none of them work for me. For example, <code>reset()</code> would clear the fields but not remove them, <code>removeData('bs.modal')</code> does not do anything, <code>.html('')</code> deletes the form entirely and not just the fields. I am in need of a method to accomplish what I want, to have new form everytime and load the content each time fresh.  </p>
  
  <p>Also hello world here is just an example, actual form fields could be many. So I do not want to create a new form in a function but rather clear it and just load certain contents. </p>
  
  <p>JS</p>
  
  <pre><code>function closeForm() {
      $('#myform').removeData('bs.modal'); 
  }
  
  function loadForm() {
      $('#myform')[0].reset();
  
      var html = "&lt;p&gt;Hello world&lt;/p&gt;";
      $("#myform").append(html);
  }
  </code></pre>
  
  <p>HTML</p>
  
  <pre><code>&lt;a href="#" class="right" data-toggle="modal" data-target="#myformDiv" onclick="loadForm()"&gt;Open form&lt;/a&gt;
  
  &lt;div class="modal fade" id="myformDiv" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"&gt;
      &lt;div class="modal-dialog modal-lg" role="document"&gt;
          &lt;div class="modal-content"&gt;
  
              &lt;div class="modal-header"&gt;
                  &lt;button onclick="closeForm()" type="button" class="close right" data-dismiss="modal" aria-label="Close"&gt;
                      &lt;span aria-hidden="true" class="close"&gt;&amp;times;&lt;/span&gt;
                  &lt;/button&gt;
              &lt;/div&gt;
  
              &lt;div class="modal-body"&gt;
                  &lt;form id="myform"&gt;
  
                  &lt;/form&gt; 
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>