<!doctype HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/ Xhtml1-transitional.dtd ">
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "/>
<title>javascript Select all checkboxes for current page check box code </title>
<script language= "JavaScript" >
function Selectalls (state)
{
var inputs = document.getElementsByTagName ("input");
for (var i=0; i< inputs.length; i++)
{
if (Inputs[i].type = "checkbox")
{
Inputs[i].checked =state;
}
}
}
</script>
<body>
<form id= "Form1" Name= "Form1" method= "Post" action= "" >
<input type= "checkbox" name= "checkbox" id= "checkbox"/>
<label for= "checkbox" ></label>
<input type= "text" name= "TextField" id= "TextField"/>
<input type= "button" name= "button" id= button "value=" button "onclick=" Javascript:selectalls (true); "/>
</form>
<label for= "TextField" ></label>
</body>