onClick="checkall(this.form)"

这样
如果要选中这个表单中全部复选框用onClick="checkall(this.form)"

那么选别的表单中的该怎么写??

<html>

<head>
<base href="file:///C:/My%20Documents/My%20Web%20Sites/Rogue%20Cellars2/new_page_2.htm" fptype="TRUE">
<meta name=vs_targetSchema content="HTML 4.0">
<meta name=vs_defaultClientScript content="JavaScript">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建网页 2</title>
<script id=clientEventHandlersJS language=javascript>
<!--

function checkall() {
var i;
for(i=1;i<200;i++)
{
try
{
//window.alert(i);
window.document.getElementById("C"+i).checked="true";
}
catch(e)
{
}
}
}

//-->
</script>
</head>

<body>

<form method="POST" action="--WEBBOT-SELF--" id="form">
<input type="checkbox" name="C1" ID="C1" value="ON" language=javascript onclick="checkall()">
<input type="checkbox" name="C2" value="ON">
<input type="checkbox" name="C3" value="ON"><input type="checkbox" name="C4" value="ON"><input type="checkbox" name="C5" value="ON"><input type="checkbox" name="C6" value="ON"><input type="checkbox" name="C7" value="ON"><input type="checkbox" name="C8" value="ON"><input type="checkbox" name="C9" value="ON"><input type="checkbox" name="C10" value="ON"><input type="checkbox" name="C11" value="ON"><input type="checkbox" name="C12" value="ON"><input type="checkbox" name="C13" value="ON"><input type="checkbox" name="C14" value="ON"><input type="checkbox" name="C15" value="ON"><input type="checkbox" name="C16" value="ON" ><input type="checkbox" name="C17" value="ON"><input type="checkbox" name="C18" value="ON"><input type="checkbox" name="C19" value="ON"><input type="checkbox" name="C20" value="ON"><input type="checkbox" name="C21" value="ON"><input type="checkbox" name="C22" value="ON">
</form>

</body>

</html>
温馨提示:内容为网友见解,仅供参考
第1个回答  2013-06-08
onClick="CheckOthers(this.form)"
相似回答