$(function(){ $('.check-all-box').click((event) => { if($(event.target).parent().data("check")=="0"){ $(event.target).attr("src",'/yonfile/frontend/web/icon/check.png'); $(event.target).parent().data("check","1"); $('.check-box').attr("src",'/yonfile/frontend/web/icon/check.png'); $('.check-box').parent().data("check","1"); }else{ $(event.target).attr("src",'/yonfile/frontend/web/icon/not_check.png'); $(event.target).parent().data("check","0"); $('.check-box').attr("src",'/yonfile/frontend/web/icon/not_check.png'); $('.check-box').parent().data("check","0"); } }); });