<script type="text/javascript">
function chkcontrol(j) {
var total=0;
var elem = document.getElementsByName('ckb');
for(var i=0; i < elem.length; i++){
if(elem[i].checked==true){
total =total +1;}
if(total > 3){
alert("Please Select only three")
elem[j].checked = false ;
return false;
}
}
} </script>
Checkbox Limit TutorialCheckbox limiting by document.form.checkbox Checkbox limiting by value demo