<script type="text/javascript">
</script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
<script language="javascript">
function check(str,num)
{//选项框名字要相同.
var checkednum=0;
var a = document.getElementsByName(str);
var n = a.length;
for (var i=0; i<n; i++)
if(a[i].checked){
checkednum++;
}
if(checkednum>num){
return false;
}else{
return true;
}
}
</script>
用法:
<input type="checkbox" name="checkbox" value="checkbox" onClick="return check('checkbox',10)">
<input type="checkbox" name="checkbox" value="checkbox" onClick="return check('checkbox',10)">
......