title: select 2 not working for ajax response
body: <p>i have following JS code where i am tring to reload my modal, when my area reloads i cannot see the select2 related contents, tho they are in the DOM when i inspect them. I am using <strong>Select2 version 4.0.2</strong></p>
  
  <pre><code>$("#add_meal_item").on('click', '#save_meal_item', function () {
                  var meal_name = $("#add_meal_item_form").find('#meal_name').val();
                  var meal_type = $("#add_meal_item_form").find('#meal_type').val();
                  var logoImg = $("#add_meal_item_form").find('#meal_image').get(0).files[0];
                  var formData = new FormData();
                  formData.append('meal_image', logoImg);
                  formData.append('meal_type', meal_type);
                  formData.append('meal_name', meal_name);
                  formData.append('_token', "{{ csrf_token() }}");
                  console.log(formData);
                  var ajax_url = baseurl + '/save_meal_item';
                  $.ajax({
                      type: "POST",
                      url: ajax_url,
                      data: formData,
                      contentType: false,
                      processData: false,
                      cache: false,
                      success: function (response) {
                          $("#add_meal_item").modal('hide');
                          $("#form_meal_body").html(response);
                          ShowSvgImage();
  
                      }
                  });
              });
  </code></pre>
  
  <p>and following is my HTML generated after ajax response</p>
  
  <pre><code>&lt;div class="modal fade in" id="add-modal-rota-user" style="display: block;"&gt;
          &lt;div class="modal-dialog routaPop" 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;×&lt;/span&gt;
                      &lt;/button&gt;
                      &lt;h4 class="modal-title"&gt;Add Meal&lt;/h4&gt;
                  &lt;/div&gt;
                  &lt;div class="modal-body inBodyForm" id="form_meal_body"&gt;&lt;form action="" method="post" inbodyform="" form-horizontal="" id="add_assigin_meal"&gt;
      &lt;div class="row"&gt;
          &lt;div class="col-md-4"&gt;
              &lt;div class="form-group"&gt;
                  &lt;label&gt;Select Main Meal: *&lt;/label&gt;
                  &lt;input type="hidden" name="meal_item_id" value=""&gt;
                  &lt;input type="hidden" name="meal_id" id="meal_id" value=""&gt;
                  &lt;div class="select"&gt;
                      &lt;select id="main_meal" class="select2 select2-hidden-accessible" name="meal_item[]" multiple=""&gt;
                          &lt;option value=""&gt;Select Meal&lt;/option&gt;
  
                              &lt;option value="1"&gt;boiled egg&lt;/option&gt;
  
                              &lt;option value="2"&gt;bread&lt;/option&gt;
  
                              &lt;option value="13"&gt;AAA&lt;/option&gt;
  
                              &lt;option value="14"&gt;123&lt;/option&gt;
  
                              &lt;option value="15"&gt;test123&lt;/option&gt;
  
                              &lt;option value="16"&gt;2231111&lt;/option&gt;
  
                              &lt;option value="17"&gt;ggggg&lt;/option&gt;
  
                              &lt;option value="18"&gt;kkkkkkkkkk&lt;/option&gt;
  
                              &lt;option value="19"&gt;test meal&lt;/option&gt;
  
                              &lt;option value="20"&gt;hello world&lt;/option&gt;
  
                              &lt;option value="21"&gt;ASDASDASD33333&lt;/option&gt;
                                                  &lt;option value="other"&gt;Other&lt;/option&gt;
                      &lt;/select&gt;
                      &lt;svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" viewBox="0 0 129 129" enable-background="new 0 0 129 129" width="512px" height="512px" class="svg replaced-svg"&gt;
    &lt;g&gt;
      &lt;path d="m88.6,121.3c0.8,0.8 1.8,1.2 2.9,1.2s2.1-0.4 2.9-1.2c1.6-1.6 1.6-4.2 0-5.8l-51-51 51-51c1.6-1.6 1.6-4.2 0-5.8s-4.2-1.6-5.8,0l-54,53.9c-1.6,1.6-1.6,4.2 0,5.8l54,53.9z" fill="#999999"&gt;&lt;/path&gt;
    &lt;/g&gt;
  &lt;/svg&gt;
                  &lt;/div&gt;
  
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="col-md-4"&gt;
              &lt;div class="form-group"&gt;
                  &lt;label&gt;Select Drinks: *&lt;/label&gt;
                  &lt;input type="hidden" name="meal_item_id" value=""&gt;
                  &lt;input type="hidden" name="meal_id" id="meal_id" value=""&gt;
                  &lt;div class="select"&gt;
                      &lt;select id="drinks" class="select2 select2-hidden-accessible" name="meal_item[]" multiple=""&gt;
                          &lt;option value=""&gt;Select Meal&lt;/option&gt;
  
                              &lt;option value="3"&gt;tea&lt;/option&gt;
  
                              &lt;option value="5"&gt;ASDASDASD&lt;/option&gt;
                                                  &lt;option value="other"&gt;Other&lt;/option&gt;
                      &lt;/select&gt;
                      &lt;svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" viewBox="0 0 129 129" enable-background="new 0 0 129 129" width="512px" height="512px" class="svg replaced-svg"&gt;
    &lt;g&gt;
      &lt;path d="m88.6,121.3c0.8,0.8 1.8,1.2 2.9,1.2s2.1-0.4 2.9-1.2c1.6-1.6 1.6-4.2 0-5.8l-51-51 51-51c1.6-1.6 1.6-4.2 0-5.8s-4.2-1.6-5.8,0l-54,53.9c-1.6,1.6-1.6,4.2 0,5.8l54,53.9z" fill="#999999"&gt;&lt;/path&gt;
    &lt;/g&gt;
  &lt;/svg&gt;
                  &lt;/div&gt;
  
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="col-md-4"&gt;
              &lt;div class="form-group"&gt;
                  &lt;label&gt;Select Deserts: *&lt;/label&gt;
                  &lt;input type="hidden" name="meal_item_id" value=""&gt;
                  &lt;input type="hidden" name="meal_id" id="meal_id" value=""&gt;
                  &lt;div class="select"&gt;
                      &lt;select id="desserts" class="select2 select2-hidden-accessible" name="meal_item[]" multiple=""&gt;
                          &lt;option value=""&gt;Select Meal&lt;/option&gt;
  
                              &lt;option value="4"&gt;cake&lt;/option&gt;
                                                  &lt;option value="other"&gt;Other&lt;/option&gt;
                      &lt;/select&gt;
                      &lt;svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" viewBox="0 0 129 129" enable-background="new 0 0 129 129" width="512px" height="512px" class="svg replaced-svg"&gt;
    &lt;g&gt;
      &lt;path d="m88.6,121.3c0.8,0.8 1.8,1.2 2.9,1.2s2.1-0.4 2.9-1.2c1.6-1.6 1.6-4.2 0-5.8l-51-51 51-51c1.6-1.6 1.6-4.2 0-5.8s-4.2-1.6-5.8,0l-54,53.9c-1.6,1.6-1.6,4.2 0,5.8l54,53.9z" fill="#999999"&gt;&lt;/path&gt;
    &lt;/g&gt;
  &lt;/svg&gt;
                  &lt;/div&gt;
  
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;div id="new_food_item_section" hidden="hidden"&gt;
              &lt;div class="col-md-4"&gt;
                  &lt;div class="form-group"&gt;
                      &lt;label&gt;Add New Meal Item: *&lt;/label&gt;
                      &lt;div class=""&gt;
                          &lt;input type="text" name="meal_name" id="meal_name"&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
              &lt;div class="col-md-12"&gt;
                  &lt;div class="form-group"&gt;
                      &lt;div class="form-group"&gt;
                          &lt;label&gt;Upload Meal Item Image: *&lt;/label&gt;
                          &lt;div class="file"&gt;
                              Upload
                              &lt;input type="file" name="meal_image" id="meal_image" class="hidden"&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
  
      &lt;/div&gt;
      &lt;input type="hidden" name="_token" value="iEfVgn5kv4ifAQmNrwOHA117nFqCHLyCIJVihmf4"&gt;
      &lt;div class="hidden_form hidden"&gt;&lt;/div&gt;
  &lt;/form&gt;
  &lt;/div&gt;
                  &lt;div class="modal-footer"&gt;
                      &lt;button class="btn btn-default" href="" type="button" id="cancel_modal"&gt;Cancel
                      &lt;/button&gt;
                      &lt;button type="button" id="saveform" class="btn btn-primary"&gt;Save&lt;/button&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>