<input name="all" type="checkbox" onclick="baoall()"><font size="2">全选</font><br>
<input name="m" type="checkbox" onclick=woyingjie()>
<input name="m" type="checkbox" onclick=woyingjie()>
<input name="m" type="checkbox" onclick=woyingjie()>
<input name="m" type="checkbox" onclick=woyingjie()>
<input name="m" type="checkbox" onclick=woyingjie()>
<input name="m" type="checkbox" onclick=woyingjie()><script language="javascript">
function baoall(){
var all=document.all.all.checked;
var inputs=document.all.m;
for (var i=0;i<inputs.length;i++){
if (all==true){
inputs[i].checked=true;
inputs[i].style.background="black"
}else{
inputs[i].checked=false;
inputs[i].style.background=""
}
}
}
function woyingjie(){
var hoho=document.all.m
for (var i=0;i<hoho.length;i++){
if (!hoho[i].checked){
document.all.all.checked=false;
return false;
}
}
document.all.all.checked=true;
return true;
}
</script>
<input name="m" type="checkbox" onclick=woyingjie()>
<input name="m" type="checkbox" onclick=woyingjie()>
<input name="m" type="checkbox" onclick=woyingjie()>
<input name="m" type="checkbox" onclick=woyingjie()>
<input name="m" type="checkbox" onclick=woyingjie()>
<input name="m" type="checkbox" onclick=woyingjie()><script language="javascript">
function baoall(){
var all=document.all.all.checked;
var inputs=document.all.m;
for (var i=0;i<inputs.length;i++){
if (all==true){
inputs[i].checked=true;
inputs[i].style.background="black"
}else{
inputs[i].checked=false;
inputs[i].style.background=""
}
}
}
function woyingjie(){
var hoho=document.all.m
for (var i=0;i<hoho.length;i++){
if (!hoho[i].checked){
document.all.all.checked=false;
return false;
}
}
document.all.all.checked=true;
return true;
}
</script>
解决方案 »
- vml实现流程图设计器
- 怎么实现登录成功后返回到我正在浏览的页面
- 两个js文件调用问题
- 急问高手一个问题。。本人系js菜鸟,散分
- ××××如何在JS里改backgroundimage××××
- JS图片轮播的问题
- 不怕难题的请进~~~难死你!
- 新手求救!
- 请问:如何实现点复选框后,使文本框由只读变成可更改?
- <IMG SRC="1.jpg" border=0 alt=按此在新窗口浏览图片 onload="javascript:if(this.width>screen.width-333)this.width=screen.width-333
- response.write "OK"居然没有显示?
- 如何用javascript实现:提交表单后,当前页面不变。
我是这样的:while($data=mysql_fetch_array($result))
printf("<td><input type='checkbox' name='select_id[]'></td>",$data[id])
但我用select_id[]替换m说缺少对象?