multiple SelectBox 전체 선택, 해제 > script

본문 바로가기
사이트 내 전체검색

script

multiple SelectBox 전체 선택, 해제

페이지 정보

작성자 서방님 댓글 0건 조회 185회 작성일 10-02-19 20:43

본문

<select name="selectbox1" size="10" multiple>
 <option>aaa</option>
 <option>aaa</option>
 <option>aaa</option>
 <option>aaa</option>
 <option>aaa</option>
 <option>aaa</option>
 <option>aaa</option>
</select><br />

<input type="button" name="Button" value="All Check" onclick="selectAll('selectbox1',true)" />
<input type="button" name="Button" value="All UnCheck" onclick="selectAllUn('selectbox1',true)" />

<script language="javascript">
<!--
function selectAll(selectBox,selectAll) {
 // have we been passed an ID
 if (typeof selectBox == "string") {
  selectBox = document.getElementById(selectBox);
 }
 // is the select box a multiple select box?
 if (selectBox.type == "select-multiple") {
  for (var i = 0; i < selectBox.options.length; i++) {
   //selectBox.options[i].selected = selectAll;
   selectBox.options[i].selected = true;
  }
 }
}
function selectAllUn(selectBox,selectAll) {
 // have we been passed an ID
 if (typeof selectBox == "string") {
  selectBox = document.getElementById(selectBox);
 }
 // is the select box a multiple select box?
 if (selectBox.type == "select-multiple") {
  for (var i = 0; i < selectBox.options.length; i++) {
   selectBox.options[i].selected = false;
  }
 }
}
//-->
</script>

 

댓글목록

등록된 댓글이 없습니다.

Total 846건 17 페이지
script 목록
번호 제목 글쓴이 조회 날짜
606 서방님 199 02-22
열람중 서방님 186 02-19
604 서방님 129 08-10
603
js 달력 댓글+ 2
서방님 77 08-10
602 서방님 116 08-10
601 서방님 153 07-29
600 서방님 128 07-21
599 서방님 203 07-06
598 서방님 115 06-04
597 서방님 198 05-28
596 서방님 101 04-20
595 서방님 177 04-15
594 서방님 198 04-10
593 서방님 166 03-13
592 서방님 158 03-10
게시물 검색

회원로그인

접속자집계

오늘
119
어제
225
최대
1,347
전체
154,878
Latest Crypto Fear & Greed Index

그누보드5
Copyright © 서방님.kr All rights reserved.