8.7w+
社区成员
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>无标题 1</title>
<script type="text/javascript" >
function checkradio()
{
var t=document.getElementsByName("abc-001-100");
for(var i=0;i<t.length;i++)
{
if(t[i].checked)
{
alert(t[i].value);
}
}
}
</script>
</head>
<body>
<input name="abc-001-100" value="A" type="radio">
<input name="abc-001-100" value="B" type="radio">
<input name="abc-001-100" value="C" type="radio">
<input type="button" value="check" onclick="checkradio()" />
</body>
</html>
<SCRIPT LANGUAGE="JavaScript">
<!--
function checkradio(){
var o=document.getElementsByName("abc-001-100");
var v=null;
for(var i=0;i<o.length;i++){
if(o[i].checked){
v=o[i].value;
break;
}
}
if(v!=null)
alert('选择值为'+v);
else
alert('未选择');
}
//-->
</SCRIPT>
</HEAD>
<BODY>
<input name="abc-001-100" value="A" type="radio">
<input name="abc-001-100" value="B" type="radio">
<input name="abc-001-100" value="C" type="radio">
<input type="button" value="check" onclick="checkradio()" />
</BODY>