下面语句有错吧,我试了好多次都不行,但又不提示出错

fengxq87 2005-04-08 09:41:11
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>
<script language=javascript>
function onClick1()
{
alert(document.form1.R1.value);
}
</script>
</head>
<body>
<form method="POST" action="" name="form1">
<input type="radio" value="V1" name="R1" id="R1" onclick="onClick1()">
<input onclick="onClick1()" type="radio" value="V2" checked name="R1">
</form>
</body>
</html>
...全文
87 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
nejtrs 2005-04-08
  • 打赏
  • 举报
回复
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>
<script language=javascript>
function onClick1(val)
{
var aa=val;
alert(aa);
}
</script>
</head>
<body>
<form method="POST" action="" name="form1">
<input type="radio" value="V1" name="R1" id="R1" onclick='onClick1("V1")'>
<input onclick='onClick1("V2")' type="radio" value="V2" checked name="R1">
</form>
</body>
</html>
stanleycheung 2005-04-08
  • 打赏
  • 举报
回复
<input type="radio" name="R1">要用radio元素数组!
fengxq87 2005-04-08
  • 打赏
  • 举报
回复
<script language=javascript>
function onClick1()
{
alert(document.form1.R1.value);
}
</script>
有,如用以上就不能显示结果,但用了THIS就可以,但我要不用THIS,也要显示结果
zhutimy 2005-04-08
  • 打赏
  • 举报
回复
用不用this有什么区别吗?
fengxq87 2005-04-08
  • 打赏
  • 举报
回复
不用THIS
hbhbhbhbhb1021 2005-04-08
  • 打赏
  • 举报
回复
你需求什么?讲讲看
fengxq87 2005-04-08
  • 打赏
  • 举报
回复
如果这样就不能符合我的要求了,
AntinomyArt 2005-04-08
  • 打赏
  • 举报
回复
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>
<script language=javascript>
function onClick1(e)
{
alert(e.value);
}
</script>
</head>
<body>
<form method="POST" action="" name="form1">
<input type="radio" value="V1" name="R1" id="R1" onclick="onClick1(this)">
<input onclick="onClick1(this)" type="radio" value="V2" checked name="R1">
</form>
</body>
</html>

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧