贴错了,应该是
<form method="POST" action="show.asp">
<input type="radio" value="V1" name="R1">1
<input type="radio" value="V2" name="R1">2
<input type="radio" value="V3" name="R1">3</p> <input type="submit" value="提交">
</form>
<form method="POST" action="show.asp">
<input type="radio" value="V1" name="R1">1
<input type="radio" value="V2" name="R1">2
<input type="radio" value="V3" name="R1">3</p> <input type="submit" value="提交">
</form>
<input type="radio" value="V1" name="R1">1
<input type="radio" value="V2" name="R1">2
<input type="radio" value="V3" name="R1">3</p> <input type="button" value="提交" onclick="test();">
</form><script>
function test(){
var objs = document.all.R1 ;
for(var i=0;i<objs.length;i++)
if (objs[i].checked)
alert(objs[i].value) ;}
</script>
<input type="radio" value="V1" name="R1">1
<input type="radio" value="V2" name="R1">2
<input type="radio" value="V3" name="R1">3</p> <input type="button" value="提交" onclick="test();">
</form><script>
function test(){
var objs = document.all.R1 ;
for(var i=0;i<objs.length;i++)
if (objs[i].checked)
alert(objs[i].value) ;}
</script>
<input type="radio" value="V1" name="R1">1
<input type="radio" value="V2" name="R1">2
<input type="radio" value="V3" name="R1">3</p> <input type="button" value="提交" onclick="test();">
</form><script>
function test(){
var objs = document.all.R1 ;
for(var i=0;i<objs.length;i++)
if (objs[i].checked)
alert(objs[i].value) ;}
</script>
<input type="radio" value="V1" name="R1">1
<input type="radio" value="V2" name="R2">2
<input type="radio" value="V3" name="R3">3</p> <input type="submit" value="提交" onclick=test();>
</form><script>
var chk=null;
function document.onclick(){
if(event.srcElement.checked)chk=event.srcElement;
}
function test(){
try{alert("所选的值为"+chk.value)}catch(e){alert("你还没选呢")}
}
</script>