<td><input id="chkall" type="checkbox" onclick="chkAll();" />全选/取消</td>
<script type="text/javascript">
function chkAll()
{
//debugger;
var chkall= document.all["chkall"];
var chkother= document.getElementsByTagName("input");
for (var i=0;i<chkother.length;i++)
{
if( chkother[i].type=='checkbox')
{
if(chkother[i].id.indexOf('TreeView1')>-1)
{
if(chkall.checked==true)
{
chkother[i].checked=true;
}
else
{
chkother[i].checked=false;
}
}
}
}
}
</script>