The example in this article describes how the jquery limit check box checkbox can be selected. Share to everyone for your reference. The specific analysis is as follows:
A small code is written because the project needs to limit the number of files that can be bulk operated
If the number of selections is greater than the maximum number of allowed other check boxes cannot be selected
If less than all check boxes can be selected
<script type= "Text/javascript" > $ (document). Ready (function () {$ (' input[type=checkbox] '). Click (function () {$
("Input[name= ' apk[]"). attr (' disabled ', true);
if ($ ("Input[name= ' apk[] ']:checked"). Length >= 3) {$ ("input[name= ' apk[] ']:checked"). attr (' disabled ', false);
else {$ (' input[name= ' apk[] '). attr (' disabled ', false);
}
}); }) </script> <ul> <li> <input type= "checkbox" Name= "apk[]" value=1/> APK1 </li> < li> <input type= "checkbox" Name= "apk[]" value=2/> APK2 </li> <li> <input type= "checkbox"
Name= "apk[]" value=1/> APK3 </li> <li> <input type= "checkbox" Name= "apk[]" value=4/> APK4 </li> <li> <input type= "checkbox" Name= "apk[]" value=6/> APK5 </li> <li> <input type= "checkbox" Name= "apk[]" value=7/> APK6 </li> <li> <input type= "checkbox" Name= "apk[]" value =8/> APK7 </Li> </ul>
I hope this article will help you with your jquery programming.