모두 체크 되었는지 확인
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
<!DOCTYPE html> <html lang="ko"> <meta charset="utf-8"> <body> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script> $(document).on("change", "input[type=checkbox]#Agree", function () { //event delegate var a = $("input[type='checkbox']#Agree"); if(a.length == a.filter(":checked").length){ alert('모두 체크되었습니다'); } }); </script> <input type="checkbox" class="abc" id="Agree"/> <input type="checkbox" class="abc" id="Agree"/> <input type="checkbox" class="abc" id="Agree"/> </body> </html> |