메뉴 건너뛰기

조회 수 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> 

  1. No Image 28Sep
    by
    2018/09/28 Views 1528 

    엔터키 / enter key submit form

  2. No Image 21Sep
    by
    2016/09/21 Views 6033 

    엔코딩/디코딩 함수

  3. No Image 16Jan
    by
    2019/01/16 Views 3387 

    엑셀처럼 td 사이즈 조절하기

  4. No Image 16Jan
    by
    2019/01/16 Views 1066 

    에러처리

  5. No Image 03Feb
    by
    2015/02/03 Views 7661 

    양력-음력

  6. No Image 20Aug
    by
    2021/08/20 Views 1708 

    시간 계산하기 (시/분/초/ 더하기, 빼기)

  7. No Image 12Sep
    by
    2016/09/12 Views 5833 

    스타일로 제목 자르기

  8. No Image 04Jul
    by
    2018/07/04 Views 3984 

    스마트에디터(SmartEditor)에서 textarea 유효성 체크하기

  9. 스마트 에디터 (네이버 에디터) 에디터 내에서 이미지 크기 줄이기.(리사이징)

  10. No Image 23Dec
    by
    2016/12/23 Views 6009 

    셀렉트(select) change 이벤트 (split)

  11. No Image 23Dec
    by
    2016/12/23 Views 5899 

    셀렉트(select) change href 이벤트

  12. No Image 23Dec
    by
    2016/12/23 Views 12577 

    셀렉트(select) change Ajax 이벤트

  13. No Image 28Apr
    by
    2015/04/28 Views 6614 

    선택된 데이터 부모창에 넘기기 (iframe ☞ 부모창)

  14. No Image 01Mar
    by 조쉬
    2014/03/01 Views 5668 

    선택된 select 의 option 값을 다른 select로 넘겨주기

  15. No Image 28Apr
    by
    2015/04/28 Views 13538 

    선택(CheckBox) 된 Row 삭제 - 화면에서 추가된 Row

  16. No Image 01Mar
    by
    2014/03/01 Views 5513 

    샘플) top left menu

  17. No Image 01Mar
    by
    2014/03/01 Views 5715 

    새창을 띠워서 focus주기

  18. No Image 28Mar
    by
    2018/03/28 Views 6001 

    새로고침(F5) 금지

  19. 비동기 작업의 원리 (JavaScript 엔진, Web API, Task Queue, Event Loop)

  20. No Image 17Nov
    by
    2016/11/17 Views 7928 

    브라우저별 이미지 크기 변경

Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 13 Next
/ 13

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

© k2s0o1d4e0s2i1g5n. All Rights Reserved