728x90
            var boardIdList = []

            $('input[name="boardIdList"]:checked').each(function (i) {
                boardIdList.push($(this).val());
            });
  • 이름이 boardIdList인 input태그의 체크된 값을 가져옴.
  • each로 반복하여 체크 개수만큼 push

* 출처 https://hanke-r.tistory.com/24

 

JavaScript - 체크박스 다중선택 value값

체크박스 다중선택 value값 가져오기 $("input[name=tblChk]:checked").each(function(){ var test = $(this).val(); console.log("체크된 값 : " + test); }); 체크박스 다중선택 value값 배열에 담기 var arTest..

hanke-r.tistory.com

 

+ Recent posts