/** * This function is to get the number of the checked checkboxes. * JK 2003-12-08 */ function getCheckedCheckboxesNum(nameOfCheckBox) { var theNum=0; var theCheckboxInputs=document.getElementsByName(nameOfCheckBox); for (var i=0;i<theCheckboxInputs.length;i++) { if(theCheckboxInputs[i].checked) theNum++; } return theNum; }
* This function is to get the number of the checked checkboxes.
* JK 2003-12-08
*/
function getCheckedCheckboxesNum(nameOfCheckBox)
{
var theNum=0;
var theCheckboxInputs=document.getElementsByName(nameOfCheckBox);
for (var i=0;i<theCheckboxInputs.length;i++)
{
if(theCheckboxInputs[i].checked) theNum++;
}
return theNum;
}
还有怎么得到每一个循环的checkbox,以便好做比较呀
theCheckboxInputs[i]就是循环得到的checkbox,随便你怎样比较。