获得选择的radio选项

<html>
<head>
<title>eeee</title>
<script lanuage="javascript">
function chec kvalue()
{
for(i=0;i<document.form1.R1.length;i++)
{
  if(document.form1.R1 .checked)
   alert(document.form1.R1.value);
}
}
</script>
</head>
<form name="form1">
<input type="radio" name="R1" value="V1" checked>1<br>
<input type="radio" name="R1" value="V2">2<br>
<input type="radio" name="R1" value="V3">3<br>
<input type="radio" name="R1" value="V4">4<br>
<input type="button" name="tt" id="tt" onclick="checkvalue()" value="确 定">
</form>
</html>

你可能感兴趣的:(Radio)