<table width="16%" border="1" style='table-layout:fixed;'>
<tbody>
<tr valign="top">
<td width="4%" height="24" align="center"><input name="check" type="checkbox" onClick="add_id(1)" value="26" ></td>
<td height="24" align="center"> </td>
</tr>
<tr valign="top">
<td height="24" align="center"><input name="check" type="checkbox" onClick="add_id(2)" value="18" ></td>
<td height="24" align="center"> </td>
</tr>
<tr valign="top">
<td height="24" align="center"><input name="check" type="checkbox" onClick="add_id(3)" value="17" ></td>
<td height="24" align="center"> </td>
</tr>
<input name="all_sel" type="hidden" value="26,18,17,16,15,14,">
<tr>
<td colspan="2" align="center"><input type="checkbox" name="all_select()" value="checkbox" onClick="document.getElementById('check').checked=this.checked">
全选
<input type="checkbox" name="un_select" value="checkbox">
反选 <br>
<input name="but_del" type="button" onClick="del_select()" value="删除所选" style="cursor:hand">
<input name="id_list" type="hidden" value="">
</td>
</tr>
</table>
<tbody>
<tr valign="top">
<td width="4%" height="24" align="center"><input name="check" type="checkbox" onClick="add_id(1)" value="26" ></td>
<td height="24" align="center"> </td>
</tr>
<tr valign="top">
<td height="24" align="center"><input name="check" type="checkbox" onClick="add_id(2)" value="18" ></td>
<td height="24" align="center"> </td>
</tr>
<tr valign="top">
<td height="24" align="center"><input name="check" type="checkbox" onClick="add_id(3)" value="17" ></td>
<td height="24" align="center"> </td>
</tr>
<input name="all_sel" type="hidden" value="26,18,17,16,15,14,">
<tr>
<td colspan="2" align="center"><input type="checkbox" name="all_select()" value="checkbox" onClick="document.getElementById('check').checked=this.checked">
全选
<input type="checkbox" name="un_select" value="checkbox">
反选 <br>
<input name="but_del" type="button" onClick="del_select()" value="删除所选" style="cursor:hand">
<input name="id_list" type="hidden" value="">
</td>
</tr>
</table>
解决方案 »
- 懂JS代码的进来看看吧。看看这个JS里面的内容是不是加密了
- 坐等紧急求助:在08server就提示microsoft jscript (25,5)缺少对象
- 熟悉dojo的请帮一下忙
- js控件问题,不知道那里出错了
- 在DW中创建图片热区出现卡机的问题。。。
- JS如何实现SELECT左列表框值添加到右边列表框
- 为什么js自定义函数不认识英文和汉字?
- 如何用JavaScript实现这个问题那????????????急急急
- 请问"收藏"用Javascript怎么做成函数?
- javascript对象的属性是否区分大小写?
- 脚本能否捕获鼠标滚轮事件
- 同一个页面中,如何根据单选下拉框的内容,动态显示页面的内容?
function checkAll(b) {
var oCheckBox = document.getElementsByName("check");
var n = oCheckBox.length;
for (var i=0;i<n;i++)
oCheckBox[i].checked=b;
}
</script>
<table width="16%" border="1" style='table-layout:fixed;'>
<tbody>
<tr valign="top">
<td width="24%" height="24" align="center"><input name="check" type="checkbox" onClick="add_id(1)"></td>
<td height="24" align="center"> </td>
</tr>
<tr valign="top">
<td height="24" align="center"><input name="check" type="checkbox" onClick="add_id(2)" value="18" ></td>
<td height="24" align="center"> </td>
</tr>
<tr valign="top">
<td height="24" align="center"><input name="check" type="checkbox" onClick="add_id(3)" value="17" ></td>
<td height="24" align="center"> </td>
</tr>
<input name="all_sel" type="hidden" value="26,18,17,16,15,14,">
<tr>
<td colspan="2" align="center"><input type="checkbox" name="all_select()" value="checkbox" onClick="checkAll(this.checked)">
全选
<input type="checkbox" name="un_select" value="checkbox">
反选 <br>
<input name="but_del" type="button" onClick="del_select()" value="删除所选" style="cursor:hand">
<input name="id_list" type="hidden" value="">
</td>
</tr>
</table>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head><script>
function CheckAll(form) {
for (var i=0;i<form.elements.length;i++) {
var e = form.elements[i];
if (e.name != 'chkall' && e.type=='checkbox')
e.checked = form.chkall.checked;
//TableBgLock(e);
}
}
</script>
<body>
<form name="form1" method="post" action=""> <p>
<input type="checkbox" name="chkall" value="checkbox" onclick="CheckAll(document.form1)">
</p>
<p> </p>
<p>
<input type="checkbox" name="checkbox" value="checkbox">
<input type="checkbox" name="checkbox2" value="checkbox">
<input type="checkbox" name="checkbox3" value="checkbox">
<input type="checkbox" name="checkbox4" value="checkbox">
<input type="checkbox" name="checkbox5" value="checkbox">
<input type="checkbox" name="checkbox6" value="checkbox">
<input type="checkbox" name="checkbox7" value="checkbox">
</p>
</form>
</body>
</html>绝对能用
function Check()
{
var checkBox=document.getElements;
for (var i=0,j=1;i<checkBox.length;i++)
{
if (typeof checkBox=="checkBox")
{
document.getElementById["Check_"+j].checked=true;
j++
}
}
}<input type="button" id="button1" onClick="Check()"/>
{
var allInputs = document.forms[0].tags('INPUT');
for( var k = 0; k < allInputs.length; k++ )
{
if( allInputs[k].type == "checkbox" )
{
allInputs[k].checked = true;
}
}
}
var checkBox=document.getElements;
for (var i=0,j=1;i<checkBox.length;i++)换成:
for(var i=0,j=1;i<document.all.length;i++)
function sl()
{
var chks = document.getElementsByName("check");
for (var i=0; i<chks.length ; i++)
{
chks[i].checked = (chks[i].checked)?false:true;
}
return true;
}</script>
</HEAD><BODY>
<table width="16%" border="1">
<tbody>
<tr valign="top">
<td width="4%" height="24" align="center"><input name="check" type="checkbox" onClick="add_id(1)" value="26" >1</td>
<td height="24" align="center"> </td>
</tr>
<tr valign="top">
<td height="24" align="center"><input name="check" type="checkbox" onClick="add_id(2)" value="18" >2</td>
<td height="24" align="center"> </td>
</tr>
<tr valign="top">
<td height="24" align="center"><input name="check" type="checkbox" onClick="add_id(3)" value="17" >3</td>
<td height="24" align="center"> </td>
</tr>
<input name="all_sel" type="hidden" value="26,18,17,16,15,14,">
<tr>
<td colspan="2" align="center"><input type="radio" name="allcheck" value="checkbox" onClick="sl();">全选
<input type="radio" name="allcheck" value="checkbox" onClick="sl();">
反选 <br>
<input name="but_del" type="button" onClick="del_select()" value="删除所选" style="cursor:hand">
<input name="id_list" type="hidden" value="">
</td>
</tr>
</table>
</BODY>
</HTML>