JS获取radio和checkbox一系列html元素
来源:互联网 发布:域名 服务器 编辑:程序博客网 时间:2024/06/04 18:33
<script type="text/javascript">
function openChildWindow()
{
var Str='aaa,bbb,ccc,ddd,';
alert(Str);
var stringArray=Str.split(',');
for(var i=0;i<stringArray.length-1;i++)
{
alert(stringArray[i]);
}
alert("asdfa");
window.open('searchuser','','toolbar,menubar,scrollbars,resizable,status,location,directories,copyhistory,height=600,width=400');
<!--window.ShowModelDialog("child.jsp");-->
}
function update(value)
{
alert();
document.getElementById("childvalue").innerHTML=value;
}
function test()
{
alert("test");
var checkbox=document.getElementsByName('test');
var radio=document.getElementsByName('test1');
for(var i=0;i<checkbox.length;i++)
{
if(checkbox[i].checked)
alert(checkbox[i].value);
}
for(var j=0;j<radio.length;j++)
{
if(radio[j].checked)
{
alert(radio[j].value);
}
}
}
</script>
</head>
<body onload="test();">
<a href="searchuser">查询</a>
<input type="button" onclick="openChildWindow();" value="打开子窗口" />
<span id="childvalue"> </span>
<form action="">
<table>
<tr>
<td><input type="checkbox" value="1" checked="checked" name="test"/></td>
<td><input type="checkbox" value="2" name="test"/></td>
<td><input type="checkbox" value="3" checked="checked" name="test"/></td>
<td><input type="checkbox" value="4" checked="checked" name="test"/></td>
<td><input type="radio" value="5" name="test1"/></td>
<td><input type="radio" value="6" name="test1"/></td>
<td><input type="radio" value="7" checked="checked" name="test1"/></td>
<td><input type="radio" value="8" name="test1"/></td>
</tr>
</table>
</form>
</body>
</html>
- JS获取radio和checkbox一系列html元素
- jQuery获取,遍历和操作表单元素Select,checkbox,radio
- jQuery获取,遍历和操作表单元素Select,checkbox,radio
- HTML radio 或者 checkbox 获取状态为选中的元素的值
- CSS模拟radio和Checkbox元素
- document.createElement("input")动态创建html元素时checkbox和radio默认选中的问题
- HTML复选框和单选框 radio checkbox
- html——radio和checkbox
- 【HTML】radio和checkbox样式美化
- js 和jquery 操作radio 和checkbox
- 获取radio和checkbox的选择值
- jQuery 操作 html 元素的例子 (input/select/checkbox/radio)
- jquery和js操作checkbox radio select
- js获取html元素
- JS中获取页面单选框radio和复选框checkbox中当前选中的值
- js 获取radio的选中值 和checkbox 的选中值
- js 获取radio的选中值 和checkbox 的选中值
- js 获取radio的选中值 和checkbox 的选中值
- 创建模式之Builder (建设)
- 创建模式之Prototype(原型)
- 创建对象之Factory (工厂)
- struts的html:radio之一默认为选中状态
- html:radio 之二--选中问题
- JS获取radio和checkbox一系列html元素
- html:radio之三默认选中
- 第一篇文章
- struts html:radio之四初始值与判断
- html:radio之五使用方法
- Fedora 10 取消某些分区的开机自动挂载
- html:select、radio之六取值问题
- Planning
- Fedora 10里将普通用户添加到sudo组