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

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

QA

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

답변 4

본문

예를들어

 

이렇게 체크박스가 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>
답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
  • 질문이 없습니다.
전체 0
© SIRSOFT
현재 페이지 제일 처음으로