[JavaScript] Radio的使用
来源:互联网 发布:java输出语句错误 编辑:程序博客网 时间:2024/06/05 10:25
Radio的使用,获取Radio的所选的值(Checkbox的使用与之类似)
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>无标题页</title>
<script type="text/javascript">...
function ShowSexSelect()
...{
var Sex;
for(var i = 0; i < document.all.sex.length; i++)
...{
if (document.all.sex[i].checked == true)...{ Sex=document.all.sex[i].value;}
}
alert(Sex);
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<table border="0" cellpadding="0" cellspacing="2" width="800px">
<tr>
<td id="td_Sex">性别:<input id="rdoMen" name="sex" type="radio" checked="checked" value="男" />男 <input id="rdoWomen" name="sex" type="radio" value="女"/>女</td>
</tr>
<tr>
<td><input id="Button1" type="button" value="ShowSexSelect" onclick="ShowSexSelect();"/></td>
</tr>
</table>
<div>
</form>
</body>
</html>
<head runat="server">
<title>无标题页</title>
<script type="text/javascript">...
function ShowSexSelect()
...{
var Sex;
for(var i = 0; i < document.all.sex.length; i++)
...{
if (document.all.sex[i].checked == true)...{ Sex=document.all.sex[i].value;}
}
alert(Sex);
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<table border="0" cellpadding="0" cellspacing="2" width="800px">
<tr>
<td id="td_Sex">性别:<input id="rdoMen" name="sex" type="radio" checked="checked" value="男" />男 <input id="rdoWomen" name="sex" type="radio" value="女"/>女</td>
</tr>
<tr>
<td><input id="Button1" type="button" value="ShowSexSelect" onclick="ShowSexSelect();"/></td>
</tr>
</table>
<div>
</form>
</body>
</html>
要注意的是:Radio的name的值一定要一致,这样它们才是一组!
- [JavaScript] Radio的使用
- radio的javascript判断
- javascript得到radio的值
- javascript 实现 radio 的联动
- javascript 实现radio 的联动
- javascript获取radio的值
- Radio Button的使用
- Radio Button的使用
- Radio、CheckBoxANDToast的使用
- Radio Button的使用
- Radio控件的使用
- radio控件的使用
- Radio Button的使用
- Radio Button(单选框) 的使用
- Radio Button控件的使用
- input 中 radio的使用
- input 中 radio的使用 .
- MFC Radio button 的使用
- sql 游戏~四数,+-*/~得另一数--实用版(原创)
- const用法
- 简单的一个可以让终端不断dhcp到不同IP的脚本
- 使用GNU automake工具集的几个步骤
- validation.xml
- [JavaScript] Radio的使用
- 五大内存分区
- 批处理教程
- struts-config.xml
- FastFileSplitter_3.2下载
- 教你学会正则表达式
- 关于linux下的jsp
- C++实现windowsMobile5.0上的UIControl开发
- 正则表达式备忘