2

I have n number of select lists. n is dynamic ( depends on the condition and range of n is 1-30). I want to run a jQuery function with .change() event. Please tell me how can I do that.

Reigel Gallarde
  • 64,198
  • 21
  • 121
  • 139
Amit Sarwara
  • 573
  • 7
  • 15

2 Answers2

3

assign same class to all your select lists, say "demo", and use on change event handler:'

$(document).on('change', '.demo', function() {
    //your code here
});
Sudhir Bastakoti
  • 99,167
  • 15
  • 158
  • 162
2

You have to give class to all your dropdowns. you can use that class to sence the change event. like

$('.dropdown').change(function(){
});

hope this will help.