首页 > Web开发 > 详细

js调用RadioButton1

时间:2016-03-18 00:00:19      阅读:346      评论:0      收藏:0      [点我收藏+]

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/javascript">
function ischeck() {
var txt1=document.getElementById("TextBox1");
var txt2=document.getElementById("TextBox2");
var rdb1=document.getElementById("RadioButton1");
var rdb2=document.getElementById("RadioButton2");
if (rdb1.checked) {
alert("RadioButton1");
txt1.value = "";
txt2.value = "";
}
if (rdb2.checked) {
alert("RadioButton2");
}
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:RadioButton ID="RadioButton1" runat="server" onclick="ischeck()" GroupName="aa"/>
<asp:RadioButton ID="RadioButton2" runat="server" onclick="ischeck()" GroupName="aa"/>
<asp:TextBox ID="TextBox1" runat="server" Text="aa" ></asp:TextBox>
<asp:TextBox ID="TextBox2" runat="server" Text="bb"></asp:TextBox>
</div>
</form>
</body>
</html>

js调用RadioButton1

原文:http://www.cnblogs.com/kaiwanlin/p/5289856.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!