title: Refreshing a div in Modal
body: <p>I am having a modal with two div user can add items by clicking on the button on the first div but as the user select that item i want to show the selected item in the second div. I am able to insert the selected item in database but i am unable to refresh the second div. So that user can see what item he has selected, Here is my jQuery code</p>
  
  <pre><code>function PreCont(cont_id) { //THIS FUNCTION ADD ITEM IN DB{
    var nit = $('#contractor').val();
    $.ajax({
      url: 'data/add_pre_cont.php',
      type: 'post',
      data: {
        nit: nit,
        cont_id: cont_id,    
      },
      success: function() {
        display_pre_cont(nit); // HERE I AM TRYING TO REFRESH THE DIV BY CALLING A FUNCTION   
      },
      error: function() {},   
    });
  }
  </code></pre>
  
  <p>This function is trying to display the data</p>
  
  <pre><code>function display_pre_cont(nit) {
    $.ajax({
      url: 'data/pre_cont_modal.php',
      type: 'post',
      data: {
        nit:nit,
      },
      success: function(data) {
        $('#pre-contractor').html(data);  
      },
      error: function (data){},
    });
  }
  </code></pre>
  
  <p>My code works fine if I refresh it i can see the new items</p>
  
  <p>HTML Code</p>
  
  <pre><code>&lt;div&gt; // First Div
      &lt;div class="table-responsive"&gt;
          &lt;table id="myTable-item-order" class="table table-bordered table-hover table-striped"&gt;
            &lt;thead&gt;&lt;tr&gt;
                &lt;th width="5%"&gt;&lt;center&gt;Cate.&lt;/center&gt;&lt;/th&gt;
                &lt;th width="5%"&gt;&lt;center&gt;Enlist&lt;/center&gt;&lt;/th&gt;
                &lt;th width="41%"&gt;&lt;center&gt;Contractor Name&lt;/center&gt;&lt;/th&gt;
                &lt;th width="19%"&gt;&lt;center&gt;District&lt;/center&gt;&lt;/th&gt;
                &lt;th width="9%"&gt;&lt;center&gt;&lt;/center&gt;&lt;/th&gt;
            &lt;/tr&gt;
                &lt;/thead&gt;
                &lt;tbody&gt;
  &lt;?php foreach($valid_contractor as $v): ?&gt;
  &lt;tr align="center"&gt;
         &lt;td width="15%"&gt;&lt;?= $v['category']; ?&gt;&lt;/td&gt;
         &lt;td&gt;&lt;?= $v['reionno']; ?&gt;&lt;/td&gt;
         &lt;td align="left"&gt;&lt;?= ucwords($v['contractorname']) ?&gt;&lt;/td&gt;
         &lt;td align="left"&gt;&lt;?= ucwords($v['district']) ?&gt;&lt;/td&gt;
         &lt;td&gt;
         &lt;button onclick="PreCont('&lt;?= $v['id']; ?&gt;');" type="button" class="btn btn-success btn-xs"&gt;
          &lt;span class="glyphicon glyphicon-plus" aria-hidden="true"&gt;&lt;/span&gt;
         &lt;/button&gt;
        &lt;/td&gt;
       &lt;/tr&gt;
           &lt;?php endforeach; ?&gt;
       &lt;/tbody&gt;
      &lt;/table&gt;
    &lt;/div&gt;
  </code></pre>
  
  <p>
  2nd Div needs to be refreshed</p>
  
  <pre><code>&lt;div class="col-md-6" id="pre-contractor"&gt;
     &lt;? require_once('modal/pre_cont_modal.php'); ?&gt;
  &lt;/div&gt;
  </code></pre>