html:
<tr>
<td align=\"right\">
</td>
<td align=\"left\" colspan=\"3\">
<input type=\"checkbox\" class=\"checkboxListItem\" name=\"checkItem\" value=\"3\" id=\"slsa_approval\" />批准
<input type=\"checkbox\" class=\"checkboxListItem\" name=\"checkItem\" value=\"4\" id=\"slsa_noApproval\" />不批准
</td>
</tr>
jquery :
$(function () {
$(\".checkboxListItem\").change( //教师
function () {
var $checkValue = $(\"input[name=\'checkItem\']:checked\").val();
if ($checkValue == 3) {
$(\"#slsa_approval\").attr(\"checked\", true);
$(\"#slsa_noApproval\").attr(\"checked\", false);
}
else {
$(\"#slsa_approval\").attr(\"checked\", false);
$(\"#slsa_noApproval\").attr(\"checked\", true);
}
});
});
通过值的判断:
var checkCheckbox = $(\"#slsa_approval\").attr(\"checked\");
if (checkCheckbox == true) {
auditState = \"3\";
} else {
auditState = \"4\";
}
本文地址:https://www.stayed.cn/item/477
转载请注明出处。
本站部分内容来源于网络,如侵犯到您的权益,请 联系我