title: My Appended HTML Not Running the Current jQuery Code
body: <p>So I'm currently working on a dynamic insert form for my website. To achieve that, I'm making a button to append a new textbox which supposed to be using Select2 plugin in it. Once I'm doing with jQuery <code>append()</code> function, the appended code not even read Select2 plugin. </p>
  
  <p>I've tried using AJAX and putting <code>$()</code> in front of the appended code. But nothing works.</p>
  
  <p>This is part of my modal's code.</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;div class="block-content"&gt;
                      &lt;div class="row"&gt;
                          &lt;div class="col-12 d-flex justify-content-end align-content-end"&gt;
                              &lt;button id="add-more-btn" class="btn btn-primary"&gt;&lt;i class="fa fa-plus"&gt;&lt;/i&gt;&amp;nbsp; Add More&lt;/button&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                      &lt;br /&gt;
                      &lt;form method="POST" action="/driver-management/create/vehicle-category"&gt;
                      @csrf 
                      &lt;div id="data-pointer" class="row d-none"&gt;
                          &lt;div class="col-12"&gt;
                          &lt;strong&gt;Data #1&lt;/strong&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                      &lt;div id="more-field"&gt;
                      &lt;div class="row"&gt;
                          &lt;div class="col-12 form-group"&gt;
                              &lt;select class="js-select2 form-control" required name="select-category" style="width: 100%;" data-placeholder="Choose one.."&gt;
                                  &lt;option&gt;&lt;/option&gt;&lt;!-- Required for data-placeholder attribute to work with Select2 plugin --&gt;
                                      @foreach($vehicle as $data)
                                      &lt;option value="{{ $loop-&gt;iteration }}"&gt; {{ $data-&gt;vehicle_cat_name }} &lt;/option&gt;
                                      @endforeach
                              &lt;/select&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                      &lt;br /&gt;
                      &lt;/div&gt;
                          &lt;div class="row"&gt;
                              &lt;div class="col-12"&gt;
                                  &lt;div class="form-group float-right"&gt;
                                      &lt;input type="submit" class="btn btn-outline-primary" id="Create" value="Submit"&gt;
                                      &lt;button type="button" class="btn btn-outline-danger" data-dismiss="modal" aria-label="Close"&gt;Close&lt;/button&gt;
                                  &lt;/div&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/form&gt;
                      &lt;!-- END Input Grid Sizes --&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;script type="text/javascript"&gt;
      let count = 0;
      $('#add-more-btn').click(function(e){
          $('#data-pointer').removeClass('d-none');
          $('#more-field').append($('&lt;div id="data-pointer" row="row"&gt; &lt;div class="col-12"&gt; &lt;strong&gt;Data #'+(count+1)+'&lt;/strong&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="row" id="data"&gt; &lt;div class="col-12 form-group"&gt; &lt;select class="js-select2 form-control" required id="select-category-'+count+'" name="select-category-'+count+'" style="width: 100%;" data-placeholder="Choose one.."&gt; &lt;option&gt;&lt;/option&gt;&lt;!-- Required for data-placeholder attribute to work with Select2 plugin --&gt; @foreach($vehicle as $kendaraan) &lt;option value="{{ $loop-&gt;iteration }}"&gt; {{ $kendaraan-&gt;vehicle_cat_name }} &lt;/option&gt; @endforeach &lt;/select&gt; &lt;/div&gt; &lt;/div&gt; &lt;br /&gt; '));
      });
  &lt;/script&gt;
  
  </code></pre>
  
  <p>If you see on my modal's part, there's some select option that has been embedded with Select2 plugin. I expect the appended code will do exactly the same as the first one. By the way, the plugin has been declared on the main page and nothing wrong with it.</p>