取得input的特殊值

if($("input[name=""+str1[0]+""]")[0]){

if(str1[0].startsWith("RESULT")){
var val = str1[1];
if(val==1){// 不同意

$($("input[name=""+str1[0]+""]")[1]).attr("checked",true);
// 不同意checked
}else{// 同意
$($("input[name=""+str1[0]+""]")[0]).attr("checked",true);// 同意
}

}

if($("input[name=""+str1[0]+""]").val()== null || $("input[name=""+str1[0]+""]").val() ==""){

$("input[name=""+str1[0]+""]").val(str1[1]);
}

}

原文地址:https://www.cnblogs.com/konglxblog/p/10011883.html