Jquery操作

------------------------------------------------------

 


var arr = new Array();
$("input:checkbox[name='checkbox']:checked").each(function (i) {
arr[i] = $(this).val();
});
var vals = arr.join(",");
alert(vals);


var boxObj = $("input:checkbox[name='id']"); //获取所有的复选框值
var expresslist = '${supplierExpressids}'; //用el表达式获取在控制层存放的复选框的值为字符串类型
var express = expresslist.split(',');
$.each(express, function(index, expressId){
boxObj.each(function () {
if($(this).val() == expressId) {
$(this).attr("checked",true);
}
});
});