主题:奇怪了
<!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 http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script language="javascript">
function aa(){
for (var i = 0;i<document.getElementById('club').length-1;i++){
if(!document.getElementById('club')[i].checked){
alert("请选择准备与TA。");
}
else{
alert("没有选中");
}
}
}
</script>
</head>
<body>
<input type="radio" value="男" name="club" id="club" />男
<input type="radio" value="女" name="club" id="club" />女<br />
<input type="button" onclick="return aa()" value="33333" />
</body>
</html>
单击button,却不执行!!!!为什么?
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script language="javascript">
function aa(){
for (var i = 0;i<document.getElementById('club').length-1;i++){
if(!document.getElementById('club')[i].checked){
alert("请选择准备与TA。");
}
else{
alert("没有选中");
}
}
}
</script>
</head>
<body>
<input type="radio" value="男" name="club" id="club" />男
<input type="radio" value="女" name="club" id="club" />女<br />
<input type="button" onclick="return aa()" value="33333" />
</body>
</html>
单击button,却不执行!!!!为什么?