title: jQuery not working when a new row is added to table
body: <p>I have a table and a button on click of which I can add row to the table. Each row in table has around 5 columns. I have two dropdowns in each row value of one dropwdown affects the value in the other dropdown. This jquery is not working for the new added rows but however is working for the existing rows. Can anyone help me in identifying what have I missed. The code is as below:</p>
  
  <p>JQuery on the first dropdown:</p>
  
  <pre><code>&lt;script&gt;
      $('.notify').on('change', function () {
          alert('hi');
          var interval = $(this).closest('td').next().closest('td').next().find('select');
          if ($(this).val() == 'A' || $(this).val() == 'C') {
              interval.val('0');
              interval.prop("disabled", true);
          } else {
              interval.prop("disabled", false);
          }
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>HTML:</p>
  
  <pre><code>&lt;table id="table" style="border: 1px solid white;"&gt;
      &lt;caption style="text-align:right"&gt;                  
          &lt;button id="addRowBtn" type="button"
                  class="btn btn-primary"&gt;Add Row&lt;/button&gt;
          &lt;button id="deleteRowBtn" type="button"
                  class="btn btn-primary"&gt;Delete Row&lt;/button&gt;
      &lt;/caption&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th style="text-align: center;width:5px;background-color: #337AB7"&gt;
                  &lt;input type="checkbox" id="checkAll" name="checkAll" /&gt;
              &lt;/th&gt;
              &lt;th style="width:25%;text-align:center;background-color: #337AB7;color: white" &gt;User&lt;/th&gt;                           
              &lt;th style="width:25%;text-align:center;background-color: #337AB7;color: white" &gt;Email Address&lt;/th&gt;
              &lt;th style="text-align:center;background-color: #337AB7;color: white" &gt;Notification Type&lt;/th&gt;
              &lt;th style="width:8%;text-align:center;background-color: #337AB7;color: white" &gt;Receive&lt;/th&gt;
              &lt;th style="width:8%;text-align:center;background-color: #337AB7;color: white" &gt;Reminder Interval (in days)&lt;/th&gt;                                                     
              &lt;th style="text-align:center;background-color: #337AB7;color: white"&gt;Created By&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;                                                                                                 
          &lt;tr class="tremail" th:each="emailmaster, stat : ${emailGrp.emailMasterList}" &gt;
              &lt;td align="center"&gt;
                  &lt;input type="checkbox" class="form-control check" id="chkEmailMaster"/&gt;
              &lt;/td&gt;
              &lt;td&gt;
                  &lt;input type="text" class="form-control emailuser" th:name="emailMasterList[__${stat.index}__].user_id" th:value="${emailmaster.user_id}"/&gt;
              &lt;/td&gt;
              &lt;td&gt;
                  &lt;input type="text" class="form-control" th:name="emailMasterList[__${stat.index}__].email_address" th:value="${emailmaster.email_address}" readonly="readonly"/&gt;
              &lt;/td&gt;
              &lt;td&gt;
                  &lt;select class="form-control notify" th:field="${emailGrp.emailMasterList[__${stat.index}__].notification_type}"&gt;                                                                
                      &lt;option value=""&gt;Select&lt;/option&gt;
                      &lt;option th:each="nMap : ${notificationMap}" th:value="${nMap.key}" th:text="${nMap.value}"&gt;&lt;/option&gt;
                  &lt;/select&gt;
              &lt;/td&gt;
              &lt;td&gt;
                  &lt;input type="checkbox" style="height: 15px;margin-top: 10px;" class="form-control" th:name="emailMasterList[__${stat.index}__].receive_flg" th:checked="${emailmaster.receive_flg}"/&gt;
              &lt;/td&gt;
              &lt;td&gt;
                  &lt;select class="form-control" th:field="${emailGrp.emailMasterList[__${stat.index}__].reminder_interval}"&gt;
                      &lt;option th:value="0"&gt;0&lt;/option&gt;
                      &lt;option th:value="1"&gt;1&lt;/option&gt;
                      &lt;option th:value="2"&gt;2&lt;/option&gt;
                      &lt;option th:value="3"&gt;3&lt;/option&gt;
                      &lt;option th:value="4"&gt;4&lt;/option&gt;
                      &lt;option th:value="5"&gt;5&lt;/option&gt;
                      &lt;option th:value="6"&gt;6&lt;/option&gt;
                      &lt;option th:value="7"&gt;7&lt;/option&gt;
                      &lt;option th:value="8"&gt;8&lt;/option&gt;
                      &lt;option th:value="9"&gt;9&lt;/option&gt;
                      &lt;option th:value="10"&gt;10&lt;/option&gt;
                  &lt;/select&gt;
              &lt;/td&gt;                                                       
              &lt;td&gt;                                                            
                  &lt;input type="text"  class="form-control" th:name="emailMasterList[__${stat.index}__].created_by" th:value="${emailmaster.created_by}" readonly="readonly"/&gt;
              &lt;/td&gt;
          &lt;/tr&gt;                                                   
      &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>