티스토리 뷰
Select All
DeSelect All
var checkboxes = []; checkboxes = $$('input[type=checkbox]'); var f = $('options'); // checkboxes 리턴값은 "[input 0, input 1, input 2, input 3]" checkboxes = f.getInputs('checkbox'); // 전체 선택 버튼 클릭하면 $('btnSelectAll').observe('click', function() { checkboxes.each(function(chkbox) { chkbox.checked = 1; }); }); // 전체 선택 해제 버튼 클릭하면 $('btnDeSelectAll').observe('click', function() { checkboxes.each(function(chkbox) { chkbox.checked = 0; }); });
[출처] http://www.ryboe.com/2008/07/10/select-all-checkboxes-with-prototype-js.html
'웹프로그래밍 > js' 카테고리의 다른 글
Prototype으로 radio 버튼 그룹의 값 받기 (0) | 2009.11.05 |
---|---|
Stereotabs: Prototype 과 Scriptaculous 로 구현한 탭 (0) | 2009.11.05 |
Scriptaculous SelectBox (0) | 2009.08.25 |
마우스 오버 스크롤 메뉴 (2) | 2009.07.07 |
모든 자바스크립트 오류를 디버그 콘솔에 던지기 (0) | 2009.06.01 |
댓글
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- javascript
- centos
- macos
- 안드로이드
- ASP
- iis
- CSS
- 한글
- git
- classic asp
- mssql
- PHP
- sencha touch
- Wordpress
- Linux
- Mac
- JQuery
- Android
- Prototype
- Debug
- 워드프레스
- nginx
- nodejs
- IOS
- JSON
- laravel
- API
- iphone
- Docker
- IE
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
글 보관함