티스토리 뷰
게시판 관리 및 이메일 등에서 자주보는 간단한 체크박스 전체 선택/해제 소스다.
*JQuery 사용
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <table summary="체크박스 전체선택/해제 테이블. 전체선택, 내용 등을 제공"> | |
| <thead> | |
| <th> | |
| <label for="01">전체선택</label> | |
| <input type="checkbox" id="01"> | |
| </th> | |
| <th>내용</th> | |
| </thead> | |
| <tbody> | |
| <tr> | |
| <td><input type="checkbox" name="checkAll"></td> | |
| <td>체크박스1</td> | |
| </tr> | |
| <tr> | |
| <td><input type="checkbox" name="checkAll"></td> | |
| <td>체크박스2</td> | |
| </tr> | |
| <tr> | |
| <td><input type="checkbox" name="checkAll"></td> | |
| <td>체크박스3</td> | |
| </tr> | |
| </tbody> | |
| </table> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| table { | |
| text-align: center; | |
| border-collapse: collapse; | |
| } | |
| table th, table td { | |
| border: 1px solid blue; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(document).ready(function(){ | |
| $("#01").click(function(){ | |
| if($("#01").prop("checked")){ | |
| $("input[name=checkAll]").prop("checked",true); | |
| }else{ | |
| $("input[name=checkAll]").prop("checked",false); | |
| } | |
| }); | |
| }); |
'Language > JAVASCRIPT & JQUERY' 카테고리의 다른 글
| 데이터 깊은 복사 , 얕은 복사 (0) | 2019.06.24 |
|---|---|
| Ajax 비동기/동기 (0) | 2017.08.30 |
| 엘리먼트 , div 영역 보이기 / 감추기 (0) | 2016.06.23 |
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- 중복쿼리
- ibatis
- 톰캣
- extend
- 깊은 복사
- jQuery
- javascript
- 얕은 복사
- 데이터 대입
- 제이쿼리
- server.xml
- 토글
- array
- 서버
- 전체선택
- 감추기
- CheckBox
- 자바스크립트
- 다중
- div 영역
- 연속쿼리
- tomcat
- remapResults
- object
- SQL
- 보이기
- 리눅스
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | ||||||
| 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| 16 | 17 | 18 | 19 | 20 | 21 | 22 |
| 23 | 24 | 25 | 26 | 27 | 28 | 29 |
| 30 |
글 보관함
