尝试在单击另一个复选框时清除 2 个复选框。我已经搜索了这个答案,并尝试使用示例中的信息,但由于某种原因,我没有尝试任何工作。这是我目前正在使用的代码。
function control()
{
/*var one = document.getElementById('one');
var two = document.getElementById('two');
var three = document.getElementById('three');*/
if(document.forms[0].one.checked == true)
{
document.forms[0].two.checked == false;
document.forms[0].three.checked == false;
}
if(document.forms[0].two.checked == true)
{
document.forms[0].three.checked == false;
document.forms[0].one.checked == false;
}
if(document.forms[0].three.checked == true)
{
document.forms[0].one.checked == false;
docuemnt.forms[0].two.checked == false;
}
}
</SCRIPT>
</head>
<body>
<form action="" method="POST" name="getArea">
<input type="checkbox" onClick="control()" name="one">Standard Shipping<br />
<input type="checkbox" onClick="control()" name="two">Overnight Shipping<br />
<input type="checkbox" onClick="control()" name="three">Priority Shipping<br />
</form>
</body>
</html>