Catch change event on input field dynamically added to Jquery Datatables table

前端 未结 2 592
野趣味
野趣味 2021-01-12 04:07

I have an ajax call that uses the following code to add some rows to a data table for each record in the response:

strAppName = data.Application_Name
maintCo         


        
2条回答
  •  囚心锁ツ
    2021-01-12 05:09

    The answer to that question is actually wrong. (He updated the answer!) You have to bind the event to a parent element because the input doesn't exist yet in order to bind the event to.

    $(document).on('change', '.maintCostField', function() { 
    

    FIDDLE

提交回复
热议问题