jquery dynamically added checkbox not working with change() function
You have to use liveQuery
or live
to bind events to dynamically added elements.
$(".otherProductCheckbox:checkbox").live('change', function(){
alert('test');
});
EDIT To work in IE, you have to use click not change
$(".otherProductCheckbox:checkbox").live('click', function(){
alert('test');
});
Since live() is now deprecated as of jQuery 1.7, I thought I'd post the solution that worked for me on the same problem (trigger event when dynamically added checkboxes are changed).
$(document).on('click', '.otherProductCheckbox', function() {
alert('test');
});