jquery - Subscribe to Change event for all checkboxes with a certain string in their id -


i want subscribe change event checkboxes in datalist control on asp.net page.

i able these checkboxes using jquery below, cannot find way subscribe change event. how using jquery below?

$("input[id*='cbxcolumn']").each(function (index, cbx) {      cbx.onchange = " togglesearch()";  }); 

jquery has function called .bind() perfect application! try this:

$("input[id*='cbxcolumn']").each(function (index, cbx) {      $(cbx).bind("change", function(){ togglesearch(); });  }); 

for more info check out link: http://api.jquery.com/bind/

or more simple example using .change() function:

$("input[id*='cbxcolumn']").each(function (index, cbx) {      $(cbx).change(function(){ alert(); });  }); 

more info on this: http://api.jquery.com/change/


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -