<form name="form1" method="post" action="">
<input type="checkbox" name="a" value="checkbox">
<input type="checkbox" name="a" value="checkbox">
<input type="checkbox" name="a" value="checkbox">
<input type="checkbox" name="b" value="checkbox">
<input type="checkbox" name="b" value="checkbox">
<input type="checkbox" name="b" value="checkbox">
......
</form>
<input type=button value="alert checkbox'value" onclick=getCheckbox()>
<script>
function getCheckbox(){
for(i=0;i<form1.children.length;i++){
if(form1.children[i].type=='checkbox')alert(form1.children[i].checked)
}
}
</script>
<input type="checkbox" name="a" value="checkbox">
<input type="checkbox" name="a" value="checkbox">
<input type="checkbox" name="a" value="checkbox">
<input type="checkbox" name="b" value="checkbox">
<input type="checkbox" name="b" value="checkbox">
<input type="checkbox" name="b" value="checkbox">
......
</form>
<input type=button value="alert checkbox'value" onclick=getCheckbox()>
<script>
function getCheckbox(){
for(i=0;i<form1.children.length;i++){
if(form1.children[i].type=='checkbox')alert(form1.children[i].checked)
}
}
</script>
解决方案 »
- EXTJS转换select为combo后,动态改变option则报错
- 为什么iis不提示"已限制此网页运行可以访问计算机的脚本或ActiveX控件..."
- 求一种JS菜单效果,内详
- 为什么给div的scrollTop赋值后,scrollTop的值始终为0,请大家指教啊!
- 关于数组形式的表单计算,请高手帮我转成多行可计算的表单!
- 如何取出计算机的名称!-在线等待。
- 【百分求解】如何判断用户选择了多少个选项?
- 關於將數組值保存到數據庫的問題
- 页面弹出时播放mp3怎么实现??javascript
- 想做一个网页菜单,有好的代码提供吗?
- 有关无边窗口的问题。。。。
- 我是新手,浏览器是如何管理内存的?up有分!
<input ....>
....
</form>
<input type=button value=click onclick=getCheckbox()>
<script>
function getCheckbox(){
for(i=0;i<form1.children.length;i++)
if(form1.children[i].type=='checkbox')alert(form1.children[i].checked)
}