The first is the js code that limits the number of checkboxes: Copy the code The code is as follows: "http://www.w3.org/TR/html4/loose.dtd"> < html> Restrict checkbox selection Quantity <br>function checkDate(n){ <br> var checkedCount=0; <br> for(var i=0;i< myForm.course.length ;i ++){ <BR> if(myForm.course[i].checked){ <BR> checkedCount++; <br><br> } <BR> } <BR> if(checkedCount>n ){ <br><br> alert("Cannot choose more than three courses"); <br><br> return false; <br><br> } <br> } <br><br> Please Select courses for this semester (up to three courses): Chinese Mathematics English Chemistry Physics Politics