I have the following fiddle in jquery :
var checks = $('input[name= "ScheduleCharge[hspecialty][]"]:checked');
$(checks).each(function(){
alert($(this).value());
});
This just refreshes the page . If I replace $(this).value() with 1 , 1 is alerted correct number of times as per the number of checkboxes. Any suggestions ?
You need to use
val()instead ofvalue()as value() is not defined by jquery and error would be causing refresh of page.