title: How to use a generated select value in jQuery?
body: <p>hello i am trying to generate a new line in the table if the user selects (AND or OR) in the dropdown a new line will be generated with the same fields, it's working on the first line but when i am trying to select on the generated line, it doesn't works</p>
  <p><strong>this is the script in jQuery i tried to add the on change on the select but it didn't do the job</strong></p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code> $(function () {
                          $('.sell').on('change', function () {
                              var id = $(this).closest("table.table-review").attr('id');  // Id of particular table
                              var val = $(this).val();
                              if(val == "AND" || val =="OR"){
                              console.log(id);
                              var div = $("&lt;tr /&gt;");
                              div.html(GetDynamicTextBox(id));
                              $("#"+id+"_tbody").append(div);
                              }
                          });
                          $(document).on("click", "#comments_remove", function () {
                              $(this).closest("tr").prev().find('td:last-child').html('&lt;button type="button" class="btn btn-danger" id="comments_remove"&gt;&lt;i class="fa fa-trash-o"&gt;&lt;/i&gt;&lt;/button&gt;');
                              $(this).closest("tr").remove();
                          });
                          function GetDynamicTextBox(table_id) {
                              //$('#comments_remove').remove();
                              var rowsLength = document.getElementById(table_id).getElementsByTagName("tbody")[0].getElementsByTagName("tr").length+1;
                              return '&lt;td&gt;'+rowsLength+'&lt;/td&gt;' + 
                              '&lt;td&gt;&lt;select  name = "DynamicTextBox" class="select form-control " value = ""&gt;&lt;option&gt;Field Name&lt;/option&gt;&lt;option&gt;Div Awada&lt;/option&gt;&lt;option&gt;Div Vlad&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;' +
                              '&lt;td&gt;&lt;select  name = "DynamicTextBox" class="select form-control " value = ""&gt;&lt;option&gt;Field Name&lt;/option&gt;&lt;option&gt;Equals&lt;/option&gt;&lt;option&gt;Greater than&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;' +
                              '&lt;td&gt;&lt;input type="text" name = "DynamicTextBox" class="form-control" value = "" placeholder="Enter Value" &gt;&lt;/td&gt;' + 
                              '&lt;td&gt;&lt;select class="form-control sell" name="argSelect" onchange="genfun()" id="mySelect"&gt;&lt;option value="Arg"&gt;Argument&lt;/option&gt;&lt;option value="AND"&gt;AND&lt;/option&gt;&lt;option value="OR"&gt;OR&lt;/option&gt;&lt;option value="ONLY"&gt;ONLY&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;' +
                              '&lt;td&gt;&lt;button type="button" class="btn btn-danger" id="comments_remove"&gt;&lt;i class="fa fa-trash-o"&gt;&lt;/i&gt;&lt;/button&gt;&lt;/td&gt;'
                          }
                          function genfun(){
                              var id = $(this).closest("table.table-review").attr('id');  // Id of particular table
                              var val = document.getElementById("mySelect").value;
                              if(val == "AND" || val =="OR"){
                              console.log(id);
                              var div = $("&lt;tr /&gt;");
                              div.html(GetDynamicTextBox(id));
                              $("#"+id+"_tbody").append(div);
                              }
                          }
                      });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;div class="table-responsive"&gt;
          &lt;table class="table table-review review-table mb-0" id="table_achievements"&gt;
          &lt;thead&gt;
          &lt;tr&gt;
          &lt;th style="width:40px;"&gt;&lt;/th&gt;
          &lt;th&gt;&lt;/th&gt;
          &lt;th&gt;&lt;/th&gt;
          &lt;th&gt;&lt;/th&gt;
          &lt;!-- &lt;th style="width: 64px;"&gt;&lt;button type="button" class="btn btn-primary btn-add-row"&gt;&lt;i class="fa fa-plus"&gt;&lt;/i&gt;&lt;/button&gt;&lt;/th&gt; --&gt;
          &lt;/tr&gt;
          &lt;/thead&gt;
          &lt;tbody id="table_achievements_tbody"&gt;
          &lt;tr&gt;
          &lt;th&gt;1&lt;/th&gt;
          &lt;th&gt;
          &lt;select class="form-control"&gt;
          &lt;option&gt;Field Name&lt;/option&gt;
          &lt;option&gt;Div Awada&lt;/option&gt;
          &lt;option&gt;Div Vlad&lt;/option&gt;
          &lt;/select&gt;
          &lt;/th&gt;
          &lt;th&gt;
          &lt;select class="form-control"&gt;
          &lt;option&gt;Equals&lt;/option&gt;
          &lt;option&gt;Greater than&lt;/option&gt;
          &lt;option&gt;Less than&lt;/option&gt;
          &lt;/select&gt;
          &lt;/th&gt;
          &lt;th&gt;&lt;input type="text" id="text2" class="form-control" placeholder="Enter Value" &gt;&lt;/th&gt;
          &lt;th style="width: 120px;"&gt;
          &lt;select class="form-control sell" name="argSelect" &gt;
          &lt;option value="Arg"&gt;Argument&lt;/option&gt;
          &lt;option value="AND"&gt;AND&lt;/option&gt;
          &lt;option value="OR"&gt;OR&lt;/option&gt;
          &lt;option value="ONLY"&gt;ONLY&lt;/option&gt;
          &lt;/select&gt;
          &lt;/th&gt;
          &lt;th style="width:92.56px;"&gt;&lt;/th&gt;
          &lt;/tr&gt;
          &lt;/tbody&gt;
          &lt;/table&gt;
          &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>