attr prop
if(attributeCodeArr){
var attributeCodeArrSplit = new Array() ;
if(attributeCodeArr.indexOf(',')>0){
attributeCodeArrSplit = attributeCodeArr.split(',');
}else{
attributeCodeArrSplit.push(attributeCodeArr);
}
$("input[name='attributeCode_update']:checkbox").each(function(i){
for(var i = 0;i<attributeCodeArrSplit.length;i++)
{
if($(this).val()==attributeCodeArrSplit[i])
{
//一些操作代码
$(this).prop("checked", true);
//.click(); //('checked', true);
//console.log($(this).attr('checked', true))
}
}
});
}
.attr('checked',true) JQ1.6之前完全没问题,可是当我们升级JQ1.6到更高的版本时用
$("input[name='servicefunId']").prop("checked", false);