211007 TIL (학습 79일차)

김영진·2021년 10월 7일
0

제이쿼리로 체크박스 모두선택과 해제 기능을 구현해 보았다.

$("#agreeAll").click(function () {
  if ($("#agreeAll").is(":checked")) {
    $("input[type='checkbox']").prop("checked", true);
    $(".agree__warning").css({"display": "none"});
    $(".agree__list .check-wrap").css({"padding-bottom": "30px"});
  } else {
    $("input[type='checkbox']").prop("checked", false);
    $(".agree__warning").css({"display": "block"});
    $(".agree__list .check-wrap").css({"padding-bottom": 0});
  }
});
profile
UI개발자 in Hivelab

0개의 댓글