方法一:
<form>
<input type="radio" name='radio' value="1" onclick='check(this)'>單選一
<input type="radio" name='radio' value="2" onclick='check(this)'>單選二
<input type="radio" name='radio2' value="1" onclick='check(this)'>單選1
<input type="radio" name='radio2' value="2" onclick='check(this)'>單選2
</form>
<script>
var tempradio= null;
function check(checkedRadio)
{
if(tempradio== checkedRadio){
tempradio.checked=false;
tempradio=null;
}
else{
tempradio= checkedRadio;
}
}
</script>
方法二: