jquery checkbox

varfolderids=[];

$.each($("#list_periodical").find("input[name='folder']"),function(i,v){

if($(v).attr("checked")=="checked"){

folderids.push($(v).val());

}

});

varsourceids=[];

$.each($("#list_periodical").find("input[name='source']"),function(i,v){

if($(v).attr("checked")=="checked"){

sourceids.push($(v).val());

}

});

vartypeids=[];

$.each($("#list_periodical").find("input[name='typeids']"),function(i,v){

if($(v).attr("checked")=="checked"){

typeids.push($(v).val());

}

});

varweiboids=[];

$.each($("#list_periodical").find("input[name='weibo']"),function(i,v){

if($(v).attr("chekced")=="checked"){

weiboids.push($(v).val());

}

});

在四个checkbox都被勾选的情况下,且都有value,猜这4个数组中哪个数组始终为null

相关推荐