<td><input id="chkall" type="kotak centang" onclick="chkAll();" />全选/取消</td>
1 <tipe skrip="teks/javascript">
2 fungsi chkAll()
3 {
4 //debugger;
5 var chkall= dokumen.semua["chkall"];
6 var chkother= document.getElementsByTagName("input");
7 untuk (var i=0;i<chkother.length;i++)
8 {
9 jika( chkother[i].type=='kotak centang')
10 {
11 if(chkother[i].id.indexOf('TreeView1')>-1)
12 {
13 if(chkall.checked==true)
14 {
15 chkother[i].checked=benar;
16 }
17 lainnya
18 {
19 chkother[i].checked=false;
20 }
21 }
22 }
23 }
24 }
25 </skrip>