[解释]
1.不但要能全部选上,还要能全部取消。
2.选取范围时实现方法有多种,要综合使用。
[例子]
1.这是一个比较通用的例子
<script language="vbscript">
function checkall
if checkall.checked = true then
for n=0 to document.all.length-1
if (left(document.all(n).id,3)="chk") then
document.all(n).checked=true
end if
next
else
for n=0 to document.all.length-1
if (left(document.all(n).id,3)="chk") then
document.all(n).checked=flase
end if
next
end if
end function