js 주소 2 급 연동 실현

1656 단어




    
    Document
    


    


:
// , var prov_list = [' ', ' ', ' ', ' ', ' ']; // , var city_list = []; city_list[0] = [' ', ' ', ' ', ' ', ' ', ' ']; city_list[1] = [' ', ' ', ' ', ' ', ' ', ' ']; city_list[2] = [' ', ' ', ' ', ' ', ' ', ' ']; city_list[3] = [' ', ' ', ' ', ' ', ' ', ' ']; city_list[4] = [' ', ' ', ' ', ' ', ' ', ' ']; // select var prov_select = document.getElementById('prov'); var city_select = document.getElementById('city'); // for (var i = 0; i < prov_list.length; i ++) { //prov_select.innerHTML += "<option>"+prov_list[i]+"</option>"; prov_select.add(new Option(prov_list[i], i)); } // change prov_select.onchange = function(){ // var index = this.value; // var citys = city_list[index]; // city_select.length = 0; // for (var i = 0; i < citys.length; i ++) { city_select.add(new Option(citys[i], i)); } } // prov_select prov_select.onchange();

좋은 웹페이지 즐겨찾기