2010. 4. 9. 16:08
반응형
<script>
 // var test = (0,0);
 var step1 = 5;

test = new Array(step1);
val = new Array(step1);
for(i=0;i<test.length;i++) {
 test[i] = new Array();
 val[i]  = new Array();
}

 test[1][0] = "젠장111";
 val[1][0] = "http://naver.com";
 test[1][1] = "펄111";
 val[1][1] = "http://yahoo.com";
 test[2][0] = "젠장222";
 val[2][0] = "http://paran.com";
 test[2][1] = "펄222";
 val[2][1] = "http://daum.com";

  function fuck(obj) {
 var ta  =  d0cument.aaa;
 ta.t2.length  = test[obj.selectedIndex].length+1;
 ta.t2[0].text = '선택';
 for(var i=0;i<test[obj.selectedIndex].length;i++) {
  ta.t2[i+1].text = test[obj.selectedIndex][i];
  ta.t2[i+1].value = val[obj.selectedIndex][i];
 }
  }

  function fuckU(turl) {
 location.href=turl.value;
  }
  </script>
  <form name="aaa">
  <select name = "t1" onchange=fuck(this);>
 <option value="">골라~</option>
 <option value="1">골라~1</option>
 <option value="2">골라~2</option>
  </select>
  <select name = "t2" onchange=fuckU(this);>
  <option value="">선택</option>
  </select>
  </form>

반응형

'Front-Html > Javascript' 카테고리의 다른 글

다음 Map Open API 설정  (5) 2011.03.21
javascript php 문자열 관련 함수 비교  (2) 2010.04.09
javascript 실시간 유동적 시간 변경  (1) 2010.04.09
javascript calendar.js  (1) 2010.04.09
javascript lightbox lib  (2) 2010.04.09
Posted by seongsland