title: How to refresh DOM with newly created elements
body: <p>I know this question was asked several times, but couldn't get the answer that works for me so here I am with my case.
  I'm trying to make a jQuery plug-in that's add contact form to a certain page(It's not like there is no such a plug-ins but let's say I do this just for educational reasons). It is searching for <code>&lt;div id="add_contacts"&gt;&lt;/div&gt;</code> and creates the form in this div.
  jQuery</p>
  
  <pre><code>$(document).ready(function(){
      $('#add_contacts').append('&lt;div class="contact-from"&gt;&lt;/div&gt;');
      $('&lt;form&gt;&lt;/form&gt;',{id:'new_contact'}).appendTo('.contact-form');
      $('&lt;div&gt;',{class:'contact_user_name'}).appendTo('#new_contact');
  
  var name_field = $('&lt;input&gt;',{
      name:"contact_broker_fullname",
      id:"contact_user_name",
  }).appendTo('.contact_user_name');
  
      var input_button = $('&lt;input&gt;',{
      name:"submit",
      type:"submit",
      value:"Send"
  }).appendTo('#new_contact');
  
      var full_name=name_filed.val();//I'm not sure that this should be here at all.
  
      input_button.on('click',function(){
      ajax_send_contact(full_name);
      return false;
  });
  });
  </code></pre>
  
  <p>And here is the <code>ajax_send_contact(full_name)</code> function:</p>
  
  <pre><code>$.ajax({
      url:'../some.php',
      type:'post',
      data:{name:full_name},
      success: function (response){
          if (response) {
              $('#success').append('&lt;span&gt;All right.&lt;/span&gt;');
          }
          else{
              $('#errors').append('&lt;span&gt;Something went wrong.&lt;/span&gt;');
          }
      },
      error: function () {
          $('#errors').append('&lt;span&gt;ERROR!&lt;/span&gt;');
      }
  });
  </code></pre>
  
  <p>I've read that when adding dynamically element to HTML they're not included into the DOM, so how can i operate with them. How i can get the value of the input so once the user click the Submit button the value is sent to ajax function. And I'm not asking only for this particular case but for the whole logic as I'm missing something quite important.</p>
  
  <p>Thank you.</p>