I have a number of checkboxes which I am wanting to check if they are checked (1) or not checked (0). I want to place the results in an array so that I can send them to the serv
As mentioned in the answers above the problem is with the index(i). But if you want to simplify the code further, How about the following code?
var checkArray = []; $('input.publish').each(function () { checkArray.push($(this).is(':checked')); }); alert(checkArray);