티스토리 뷰
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
- Linux
- PHP
- nodejs
- centos
- ASP
- iphone
- macos
- IOS
- iis
- Docker
- mssql
- IE
- git
- Android
- classic asp
- JSON
- JQuery
- 안드로이드
- Prototype
- javascript
- 한글
- sencha touch
- API
- Mac
- Debug
- laravel
- CSS
- nginx
- 워드프레스
- Wordpress
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
글 보관함