<html>
<head> <script language="javascript">
var checkValue = "";
var radios = document.getElementsByName("test");
function nowChecked(){
for(var i=;i<radios.length;i++){
if(radios[i].checked){
checkValue = radios[i].value;
}
}
}
function change(n){ //alert("checkValue:"+checkValue+" n:"+n);
if(checkValue != n){ if(confirm("确认修改?")){
radios[n].checked =true;
nowChecked();
}else{
radios[checkValue].checked = true;
}
}
}
</script>
</head> <body onload="nowChecked()">
<input type="radio" name="test" value="" checked="checked" onclick="change(0)"/>是
<input type="radio" name="test" value="" onclick="change(1)"/>否
</body> </html>