전체 선택은 어떻게 만들죠??

전체 선택은 어떻게 만들죠??

QA

전체 선택은 어떻게 만들죠??

본문

예를들어

 

이렇게 체크박스가 4개라고 할때 전체선택을 누르면 체크가 되는 방식 그리고 전송시키는 방식은 어떻게 만드나요..? 예시를..

 

전체선택 <input type="checkbox" name="all">

<input type="checkbox" name="1">

<input type="checkbox" name="2"> 

<input type="checkbox" name="3"> 

<input type="checkbox" name="4"> 

 

 

이 질문에 댓글 쓰기 :

답변 4

전체선택 <input type="checkbox" name="all" class="all"> <input type="checkbox" class="chk" name="1"> <input type="checkbox" class="chk" name="2"> <input type="checkbox" class="chk" name="3"> <input type="checkbox" class="chk" name="4"> <script src="//code.jquery.com/jquery.min.js"></script> <script> $(document).ready(function(){ $(".all").click(function(){ if($(".all").prop("checked")){ $(".chk").prop("checked",true); }else{ $(".chk").prop("checked",false); } }) }) </script>
답변을 작성하시기 전에 로그인 해주세요.
전체 0
QA 내용 검색
  • 개별 목록 구성 제목 답변작성자조회작성일
  • 질문이 없습니다.

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT