javascript - jQuery function not working for dynamically added field -


i added group of fields dynamically. , assign class jquery function it. first row working fine when insert send row jquery function not working. insert dynamic field same class.

$(".catg").change(function(){   var classes = $(this).parents('.col-sm-3').parents('.input-group').attr('id');   alert(classes); }); 

you should use .on() create delegated events:

$(document).on('change', '.catg', function(){   var classes = $(this).parents('.col-sm-3').parents('.input-group').attr('id');   alert(classes); }); 

Comments

Popular posts from this blog

ios - MKAnnotationView layer is not of expected type: MKLayer -

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -