메뉴 건너뛰기

조회 수 5668 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
<html>
<head>
 <SCRIPT LANGUAGE="JavaScript">
  function moveOver() {
 var boxLength = document.choiceForm.choiceBox.length;
 var selectedItem = document.choiceForm.available.selectedIndex;
 var selectedText = document.choiceForm.available.options[selectedItem].text;
 var selectedValue = document.choiceForm.available.options[selectedItem].value;
 var i;
 var isNew = true;
  if (boxLength != 0) {
   for (i = 0; i < boxLength; i++) {
    thisitem = document.choiceForm.choiceBox.options[i].text;
     if (thisitem == selectedText) {
      isNew = false;
      break;
     }
    }
  } 
  if (isNew) {
   newoption = new Option(selectedText, selectedValue, false, false); 
   document.choiceForm.choiceBox.options[boxLength] = newoption;
  }
  document.choiceForm.available.selectedIndex=-1;
 }
  function removeMe() {
 var boxLength = document.choiceForm.choiceBox.length;
  arrSelected = new Array();
 var count = 0;
  for (i = 0; i < boxLength; i++) {
   if (document.choiceForm.choiceBox.options[i].selected) {
    arrSelected[count] = document.choiceForm.choiceBox.options[i].value;
   }
   count++;
  }
 var x;
  for (i = 0; i < boxLength; i++) {
   for (x = 0; x < arrSelected.length; x++) {
    if (document.choiceForm.choiceBox.options[i].value == arrSelected[x]) {
     document.choiceForm.choiceBox.options[i] = null;
       }
   }
   boxLength = document.choiceForm.choiceBox.length;
     }
 }
 </script>
</HEAD>
<BODY>
 <center>
<form name="choiceForm">
<table border=0>
<tr>
<td valign="top" width=175>
 <br>
<select name="available" style="width:150" size=10 onchange="moveOver();">
<option value=1>1 
<option value=2>2
<option value=3>3 
<option value=4>4
<option value=5>5
</select>
</td>
<td valign="top">
 <br>
<select multiple name="choiceBox" style="width:150;" size="10">
</select>
</td>
</tr>
<tr>
<td colspan=2 height=10>
                                                 <input type="button" value="제거" onclick="removeMe();">
</td>
</tr>
</table>
</form>
</center> 

List of Articles
번호 제목 날짜 조회 수
167 Location 객체 - URL 파싱 - URL에서 전달인자 추출하기 함수 작성 file 2015.06.19 8523
166 location.href 로 새창 여는 방법 (target=_blank 효과) 2015.06.19 9397
165 Node.js와 npm(+ npx)의 개념 2023.01.20 134
164 onkeypress 키보드 이벤트 처리하는 법 – text, textarea 2016.09.21 7001
163 opener 값전달, 함수실행.(자식창에서 부모창으로 값전달, 함수실행) 2021.03.26 1437
162 response.setHeader 2016.12.22 7358
161 select 당일 날짜 출력 file 2014.03.01 5780
160 SelectBox에서 선택된 항목의 텍스트, 값 가져오기 선택 옵션 넣기. 2018.07.04 4014
159 setTimeout 대체 스크립트 함수 (일시멈춤) 2016.12.22 6241
158 setTimeout() / clearTimeout() / setInterval() 2016.12.22 8162
157 span - 동적으로 글자 바꾸기, 보이기 안보이기 2019.01.16 1446
156 split, join, replace, replace_all 2021.03.26 204
155 Textarea 글자수 체크 2014.03.01 5651
154 textarea의 글자수 제한 2014.02.27 6161
153 top 부분이 고정되는 슬라이딩 메뉴입니다 file 2014.03.01 5752
152 utf-8일때 alert 한글 깨짐 해결 2021.03.26 3558
151 [INPUT BOX] 텍스트박스(INPUT 박스) 가 동적으로 추가,삭제됩니다 2017.02.19 8526
150 [jQuery] textarea 글자수 카운트 2014.03.01 7420
149 [jQuery] 상위부터 차례로 지역 선택하기 2014.03.01 45980
148 [jQuery] 실시간 검색어 순위 순서대로 보여주기 2014.03.01 12017
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 13 Next
/ 13

하단 정보를 입력할 수 있습니다

© k2s0o1d4e0s2i1g5n. All Rights Reserved