checkboxʵÏÖÈ«Ñ¡µÄ¶àÖÖ·½·¨

<script language="javascript">
//µÚÒ»ÖÖ·½·¨
function selectall1()
{
??? var a = document.getElementsByTagName("input");
??? if(a[0].checked==true){
??? for (var i=0; i<a.length; i++)="" <br="">?????? if (a[i].type == "checkbox") a[i].checked = false;
??? }
??? else
??? {
??? for (var i=0; i<a.length; i++)="" <br="">?????? if (a[i].type == "checkbox") a[i].checked = true;
??? }
}
//µÚ¶þÖÖ·½·¨
function selectall2() {
var tform = document.forms['form1'];
for (var i=0;i<tform.length;i++) <br="">{
?? var e = tform.elements[i];
?? if (e.type == "checkbox")
??? e.checked = !e.checked;
}
}

//µÚÈýÖÖ·½·¨£¬½áºÏÉÏÊöÁ½ÖÖ·½·¨
function selectall3()
{
??? var a = document.getElementsByTagName("input");
??? for (var i=0; i<a.length; i++)="" <br="">?????? if (a[i].type == "checkbox") a[i].checked =!a[i].checked;
?? }
//µÚËÄ·½·¨
function selectall4(id){ //ÓÃidÇø·Ö??
var tform=document.forms['form1'];??
for(var i=0;i<tform.length;i++){??<br>var e=tform.elements[i];??
if(e.type=="checkbox" && e.name==id) e.checked=!e.checked;??
}??
}
//µÚÎåÖÖ·½·¨
function selectall5(theform,thename){
var tform=document.forms[theform];
//document.getElementById("thewen").value='·´Ñ¡';
for(var i=0;i<tform.length;i++){ <br="">??? var e=tform.elements[i];
??? if(e.type=='checkbox' && e.name==thename)e.checked=!e.checked;
?? }
}
</script>


??



??
??
??
??
??

你可能感兴趣的:(JavaScript)